@@ -143,10 +143,9 @@ struct NonTrivialValueType {
143
143
func testCaseNonTrivialValue( ) {
144
144
var i = NonTrivialValueType ( 17 , Klass ( ) )
145
145
f {
146
- // Currently emits a typechecker level error due to some sort of bug in the type checker.
147
- // print(i.i + 17)
148
- // print(i.i + 18)
149
- // print(i.i + 19)
146
+ print ( i. i + 17 )
147
+ print ( i. i + 18 )
148
+ print ( i. i + 19 )
150
149
}
151
150
152
151
i. i = 20
@@ -155,28 +154,27 @@ func testCaseNonTrivialValue() {
155
154
// We only emit a warning here since we use the last write.
156
155
//
157
156
// TODO: Should we emit for all writes?
158
- i. i. addOne ( ) // xpected -warning {{'i' mutated after capture by concurrent closure}}
159
- // xpected -note @-14 {{variable defined here}}
160
- // xpected -note @-14 {{variable captured by concurrent closure}}
161
- // xpected -note @-14 {{capturing use}}
162
- // xpected -note @-14 {{capturing use}}
163
- // xpected -note @-14 {{capturing use}}
157
+ i. i. addOne ( ) // expected -warning {{'i' mutated after capture by concurrent closure}}
158
+ // expected -note @-14 {{variable defined here}}
159
+ // expected -note @-14 {{variable captured by concurrent closure}}
160
+ // expected -note @-14 {{capturing use}}
161
+ // expected -note @-14 {{capturing use}}
162
+ // expected -note @-14 {{capturing use}}
164
163
}
165
164
166
165
func testCaseNonTrivialValueInout( ) {
167
166
var i = NonTrivialValueType ( 17 , Klass ( ) )
168
167
f {
169
- // Currently emits a typechecker level error due to some sort of bug in the type checker.
170
- // print(i.i + 17)
171
- // print(i.k ?? "none")
168
+ print ( i. i + 17 )
169
+ print ( i. k ?? " none " )
172
170
}
173
171
174
172
// We only emit a warning here since we use the last write.
175
- inoutUserOptKlass ( & i. k) // xpected -warning {{'i' mutated after capture by concurrent closure}}
176
- // xpected -note @-8 {{variable defined here}}
177
- // xpected -note @-8 {{variable captured by concurrent closure}}
178
- // xpected -note @-8 {{capturing use}}
179
- // xpected -note @-8 {{capturing use}}
173
+ inoutUserOptKlass ( & i. k) // expected -warning {{'i' mutated after capture by concurrent closure}}
174
+ // expected -note @-8 {{variable defined here}}
175
+ // expected -note @-8 {{variable captured by concurrent closure}}
176
+ // expected -note @-8 {{capturing use}}
177
+ // expected -note @-8 {{capturing use}}
180
178
}
181
179
182
180
protocol MyProt {
@@ -187,9 +185,8 @@ protocol MyProt {
187
185
func testCaseAddressOnlyAllocBoxToStackable< T : MyProt > ( i : T ) {
188
186
var i2 = i
189
187
f {
190
- // Currently emits an error due to some sort of bug in the type checker.
191
- // print(i2.i + 17)
192
- // print(i2.k ?? "none")
188
+ print ( i2. i + 17 )
189
+ print ( i2. k ?? " none " )
193
190
}
194
191
195
192
// TODO: Make sure we emit these once we support address only types!
@@ -206,9 +203,8 @@ func testCaseAddressOnlyNoAllocBoxToStackable<T : MyProt>(i : T) {
206
203
let f2 = F ( )
207
204
var i2 = i
208
205
f2. useConcurrent {
209
- // Currently emits a typechecker level error due to some sort of bug in the type checker.
210
- // print(i2.i + 17)
211
- // print(i2.k ?? "none")
206
+ print ( i2. i + 17 )
207
+ print ( i2. k ?? " none " )
212
208
}
213
209
214
210
// TODO: Make sure we emit these once we support address only types!
0 commit comments