mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
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:
15
test/stdlib/KeyPathMultiFile.swift
Normal file
15
test/stdlib/KeyPathMultiFile.swift
Normal 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()
|
||||
Reference in New Issue
Block a user