SILGen: Fix key paths that reference internal private(set) decls from other files.

The setter needs to be given hidden linkage so that other files can still form key paths to it.
This commit is contained in:
Joe Groff
2018-07-09 20:19:51 -07:00
parent b607e549f1
commit ae4d40ac85
8 changed files with 81 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
// RUN: %empty-directory(%t)
// RUN: cp %s %t/main.swift
// RUN: %target-build-swift -o %t/a.out %t/main.swift %S/Inputs/KeyPathMultiFile_b.swift
// RUN: %target-run %t/a.out
import StdlibUnittest
var keyPathMultiFile = TestSuite("key paths across multiple files")
keyPathMultiFile.test("identity across multiple files") {
expectEqual(A_x_keypath(), \A.x)
expectEqual(A_subscript_0_keypath(), \A.[0])
}
runAllTests()