88// RUN: %sourcekitd-test -req=interface-gen -module MyModule -- -target %target-triple -I %t | %FileCheck %s --check-prefix=SWIFTMODULE
99// RUN: %sourcekitd-test -req=doc-info -module MyModule -- -target %target-triple -I %t | %FileCheck %s --check-prefix=DOCINFO
1010
11+ @available ( SwiftStdlib 5 . 1 , * )
12+ @globalActor
13+ public struct PublicActor {
14+ public actor MyActor { }
15+ public static let shared = MyActor ( )
16+ }
17+
18+ @available ( SwiftStdlib 5 . 1 , * )
19+ @globalActor
20+ struct InternalActor {
21+ actor MyActor { }
22+ static let shared = MyActor ( )
23+ }
24+
1125@propertyWrapper
12- public struct OrLess {
26+ public struct PublicOrLess {
1327 private var threshold : Int
1428 private var number : Int = 0
15- init ( wrappedValue: Int , threshold: Int ) {
29+
30+ public init ( wrappedValue: Int , threshold: Int ) {
1631 self . threshold = threshold
1732 self . wrappedValue = wrappedValue
1833 }
@@ -22,38 +37,78 @@ public struct OrLess {
2237 }
2338}
2439
40+ @propertyWrapper
41+ struct InternalOrLess {
42+ private var threshold : Int
43+ private var number : Int = 0
44+
45+ init ( wrappedValue: Int , threshold: Int ) {
46+ self . threshold = threshold
47+ self . wrappedValue = wrappedValue
48+ }
49+ var wrappedValue : Int {
50+ get { return number }
51+ set { number = min ( newValue, 12 ) }
52+ }
53+ }
54+
2555@resultBuilder
26- public struct IntBuilder {
56+ public struct PublicBuilder {
2757 public static func buildBlock( _ val: Int ) -> Int { val }
2858}
2959
60+ @resultBuilder
61+ struct InternalBuilder {
62+ static func buildBlock( _ val: Int ) -> Int { val }
63+ }
64+
65+
3066public struct TestStruct {
3167
3268 @MainActor public func mainActorMethod( ) { }
3369 @MainActor ( unsafe) public func mainActorUnsafeMethod( ) { }
3470
35- @OrLess ( threshold: 12 ) public var twelveOrLess = 13
71+ @available ( SwiftStdlib 5 . 1 , * )
72+ @PublicActor public func publicActorMethod( ) { }
73+ @available ( SwiftStdlib 5 . 1 , * )
74+ @InternalActor public func internalActorMethod( ) { }
75+
76+ @PublicOrLess ( threshold: 12 ) public var publicOrLess = 13
77+ @InternalOrLess ( threshold: 42 ) public var internalOrLess = 56
3678
37- @IntBuilder public var intValue : Int { 1 }
79+ @PublicBuilder public var publicBuilderVal : Int { 1 }
80+ @InternalBuilder public var internalBuilderVal : Int { 1 }
3881}
3982
4083// SWIFTSOURCE: public struct TestStruct {
4184// SWIFTSOURCE: @MainActor public func mainActorMethod()
4285// SWIFTSOURCE: @MainActor public func mainActorUnsafeMethod()
43- // SWIFTSOURCE: @MyModule.OrLess public var twelveOrLess: Int { get set }
44- // SWIFTSOURCE: @MyModule.IntBuilder public var intValue: Int { get }
86+ // SWIFTSOURCE: @MyModule.PublicActor public func publicActorMethod()
87+ // SWIFTSOURCE: @MyModule.InternalActor public func internalActorMethod()
88+ // SWIFTSOURCE: @MyModule.PublicOrLess public var publicOrLess: Int { get set }
89+ // SWIFTSOURCE: @MyModule.InternalOrLess public var internalOrLess: Int { get set }
90+ // SWIFTSOURCE: @MyModule.PublicBuilder public var publicBuilderVal: Int { get }
91+ // SWIFTSOURCE: @MyModule.InternalBuilder public var internalBuilderVal: Int { get }
4592// SWIFTSOURCE: }
4693
4794// SWIFTMODULE: public struct TestStruct {
4895// SWIFTMODULE: @MainActor public func mainActorMethod()
4996// SWIFTMODULE: @MainActor public func mainActorUnsafeMethod()
50- // SWIFTMODULE: @MyModule.OrLess public var twelveOrLess: Int
51- // SWIFTMODULE: @MyModule.IntBuilder public var intValue: Int { get }
97+ // SWIFTMODULE: @MyModule.PublicActor public func publicActorMethod()
98+ // SWIFTMODULE: public func internalActorMethod()
99+ // SWIFTMODULE: @MyModule.PublicOrLess public var publicOrLess: Int
100+ // SWIFTMODULE: public var internalOrLess: Int
101+ // SWIFTMODULE: @MyModule.PublicBuilder public var publicBuilderVal: Int { get }
102+ // SWIFTMODULE: public var internalBuilderVal: Int { get }
52103// SWIFTMODULE: }
53104
54105// DOCINFO: struct TestStruct {
55106// DOCINFO: @MainActor func mainActorMethod()
56107// DOCINFO: @MainActor func mainActorUnsafeMethod()
57- // DOCINFO: @MyModule.OrLess var twelveOrLess: Int
58- // DOCINFO: @MyModule.IntBuilder var intValue: Int { get }
108+ // DOCINFO: @MyModule.PublicActor func publicActorMethod()
109+ // DOCINFO: func internalActorMethod()
110+ // DOCINFO: @MyModule.PublicOrLess var publicOrLess: Int
111+ // DOCINFO: var internalOrLess: Int
112+ // DOCINFO: @MyModule.PublicBuilder var publicBuilderVal: Int { get }
113+ // DOCINFO: var internalBuilderVal: Int { get }
59114// DOCINFO: }
0 commit comments