Skip to content

Commit f6b1cc0

Browse files
committed
Tests: Add a regression test for module interface printing of conditionally available property wrappers.
1 parent 8862b1b commit f6b1cc0

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// RUN: %empty-directory(%t)
2+
// RUN: %target-swift-emit-module-interface(%t/Library.swiftinterface) %s -module-name Library -target %target-swift-abi-5.3-triple
3+
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library
4+
// RUN: %FileCheck %s < %t/Library.swiftinterface
5+
6+
@available(SwiftStdlib 5.2, *)
7+
@propertyWrapper
8+
public struct ConditionallyAvailableWrapper<T> {
9+
public var wrappedValue: T
10+
11+
public init(wrappedValue: T) {
12+
self.wrappedValue = wrappedValue
13+
}
14+
}
15+
16+
// CHECK: public struct HasWrappers {
17+
public struct HasWrappers {
18+
// CHECK: @available(macOS 10.15.4, iOS 13.4, watchOS 6.2, tvOS 13.4, *)
19+
// CHECK-NEXT: @Library.ConditionallyAvailableWrapper public var x: Swift.Int {
20+
// CHECK-NEXT: get
21+
// CHECK-NEXT: @available(iOS 13.4, tvOS 13.4, watchOS 6.2, macOS 10.15.4, *)
22+
// CHECK-NEXT: set
23+
// CHECK-NEXT: @available(iOS 13.4, tvOS 13.4, watchOS 6.2, macOS 10.15.4, *)
24+
// CHECK-NEXT: _modify
25+
// CHECK-NEXT: }
26+
@available(SwiftStdlib 5.2, *)
27+
@ConditionallyAvailableWrapper public var x: Int
28+
}

0 commit comments

Comments
 (0)