@@ -21,6 +21,15 @@ struct Wrapper<T> {
21
21
}
22
22
}
23
23
24
+ @propertyWrapper
25
+ struct ImplementationDetailWrapper < T> {
26
+ var wrappedValue : T
27
+
28
+ init ( wrappedValue: T ) {
29
+ self . wrappedValue = wrappedValue
30
+ }
31
+ }
32
+
24
33
func globalFunc( @Wrapper arg: Int ) {
25
34
let _: Int = arg
26
35
let _: Projection < Int > = $arg
@@ -36,6 +45,17 @@ func testGlobalFunc(value: Int, projection: Projection<Int>) {
36
45
let _: ( Projection < Int > ) -> Void = globalFunc ( $arg: )
37
46
}
38
47
48
+ func globalFuncWithImplementationDetailWrapper( @ImplementationDetailWrapper arg: Int ) {
49
+ let _: Int = arg
50
+ let _: ImplementationDetailWrapper < Int > = _arg
51
+ }
52
+
53
+ func testGlobalFuncWithImplementationDetailWrapper( value: Int ) {
54
+ globalFuncWithImplementationDetailWrapper ( arg: value)
55
+
56
+ let _: ( Int ) -> Void = globalFuncWithImplementationDetailWrapper
57
+ let _: ( Int ) -> Void = globalFuncWithImplementationDetailWrapper ( arg: )
58
+ }
39
59
40
60
struct S < Value> {
41
61
func method( @Wrapper arg: Value ) {
@@ -44,11 +64,21 @@ struct S<Value> {
44
64
let _: Wrapper < Value > = _arg
45
65
}
46
66
67
+ func methodWithImplementationDetailWrapper( @ImplementationDetailWrapper arg: Value ) {
68
+ let _: Value = arg
69
+ let _: ImplementationDetailWrapper < Value > = _arg
70
+ }
71
+
47
72
static func staticMethod( @Wrapper arg: Value ) {
48
73
let _: Value = arg
49
74
let _: Projection < Value > = $arg
50
75
let _: Wrapper < Value > = _arg
51
76
}
77
+
78
+ static func staticMethodWithImplementationDetailWrapper( @ImplementationDetailWrapper arg: Value ) {
79
+ let _: Value = arg
80
+ let _: ImplementationDetailWrapper < Value > = _arg
81
+ }
52
82
}
53
83
54
84
func testMethods( instance: S < String > , Metatype: S < String > . Type ,
@@ -76,6 +106,22 @@ func testMethods(instance: S<String>, Metatype: S<String>.Type,
76
106
let _: ( S ) -> ( Projection < String > ) -> Void = Metatype . method ( $arg: )
77
107
}
78
108
109
+ func testMethodsWithImplementationDetailWrapper( instance: S < String > , Metatype: S < String > . Type ,
110
+ @ImplementationDetailWrapper value: String ) {
111
+ Metatype . staticMethodWithImplementationDetailWrapper ( arg: value)
112
+
113
+ instance. methodWithImplementationDetailWrapper ( arg: value)
114
+
115
+ let _: ( String ) -> Void = Metatype . staticMethodWithImplementationDetailWrapper
116
+ let _: ( String ) -> Void = Metatype . staticMethodWithImplementationDetailWrapper ( arg: )
117
+
118
+ let _: ( String ) -> Void = instance. methodWithImplementationDetailWrapper
119
+ let _: ( String ) -> Void = instance. methodWithImplementationDetailWrapper ( arg: )
120
+
121
+ let _: ( S ) -> ( String ) -> Void = Metatype . methodWithImplementationDetailWrapper
122
+ let _: ( S ) -> ( String ) -> Void = Metatype . methodWithImplementationDetailWrapper ( arg: )
123
+ }
124
+
79
125
func testClosures( ) {
80
126
typealias PropertyWrapperTuple = ( Wrapper < Int > , Int , Projection < Int > )
81
127
@@ -88,6 +134,12 @@ func testClosures() {
88
134
}
89
135
}
90
136
137
+ func testClosuresWithImplementationDetailWrapper( ) {
138
+ let _: ( Int ) -> ( ImplementationDetailWrapper < Int > , Int ) = { ( @ImplementationDetailWrapper value) in
139
+ ( _value, value)
140
+ }
141
+ }
142
+
91
143
func projectionPlaceholder< T> ( @Wrapper _ value: T ) { }
92
144
93
145
func testOmittedProjectionLabel( value: Int ) {
0 commit comments