|
| 1 | +// RUN: %empty-directory(%t) |
| 2 | +// RUN: split-file %s %t |
| 3 | + |
| 4 | +// RUN: %target-swift-frontend -emit-module -module-name Library \ |
| 5 | +// RUN: -swift-version 5 -enable-library-evolution \ |
| 6 | +// RUN: -o %t/Library.swiftmodule \ |
| 7 | +// RUN: -emit-module-interface-path %t/Library.swiftinterface \ |
| 8 | +// RUN: %t/Library.swift |
| 9 | + |
| 10 | +/// Verify that we can build from the Library.swiftmodule |
| 11 | +// RUN: %target-swift-frontend -typecheck -module-name Client \ |
| 12 | +// RUN: -swift-version 5 \ |
| 13 | +// RUN: %t/Client.swift -I%t |
| 14 | + |
| 15 | +/// Verify what we can build from a swiftinterface, when swiftmodule was deleted |
| 16 | +// RUN: rm %t/Library.swiftmodule |
| 17 | +// RUN: %target-swift-frontend -typecheck -module-name Client \ |
| 18 | +// RUN: -swift-version 5 \ |
| 19 | +// RUN: %t/Client.swift -I%t |
| 20 | + |
| 21 | +// REQUIRES: executable_test |
| 22 | + |
| 23 | +//--- Library.swift |
| 24 | +public struct AStruct { |
| 25 | + public static var property1: Int = 1 |
| 26 | + private(set) public static var property2: Int = 4 |
| 27 | + private(set) public static var property3: Int = 4 |
| 28 | +} |
| 29 | + |
| 30 | +//--- Client.swift |
| 31 | +import Library |
| 32 | + |
| 33 | +public let keyPath1 = \AStruct.Type.property1 |
| 34 | +public let keyPath2 = \AStruct.Type.property2 |
| 35 | +public let keyPath3 = \AStruct.Type.property3 |
| 36 | + |
| 37 | +// CHECK: false |
| 38 | +print(keyPath1 == keyPath2) |
| 39 | + |
| 40 | +// CHECK: true |
| 41 | +print(keyPath2 == keyPath3) |
| 42 | + |
0 commit comments