File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -311,6 +311,9 @@ let _: DynamicIUO = o[dyn_iuo]!
311
311
let _: DynamicIUO = o [ dyn_iuo] !!
312
312
let _: DynamicIUO? = o [ dyn_iuo]
313
313
// FIXME: These should all produce lvalues that we can write through
314
+ o. t = s // expected-error {{cannot assign to property: 'o' is immutable}}
315
+ o. t! = s // expected-error {{cannot assign through '!': 'o' is immutable}}
316
+ o. t!! = s // expected-error {{cannot assign through '!': 'o' is immutable}}
314
317
o [ dyn_iuo] = dyn_iuo // expected-error {{cannot assign through subscript: 'o' is immutable}}
315
318
o [ dyn_iuo] ! = dyn_iuo // expected-error {{cannot assign through '!': 'o' is immutable}}
316
319
o [ dyn_iuo] !! = dyn_iuo // expected-error {{cannot assign through '!': 'o' is immutable}}
Original file line number Diff line number Diff line change @@ -247,3 +247,7 @@ func rdar83352038() {
247
247
return foo ( cnode)
248
248
}
249
249
}
250
+
251
+ // Make sure we reject an attempt at a function conversion.
252
+ func returnsIUO( ) -> Int ! { 0 }
253
+ let _ = ( returnsIUO as ( ) -> Int ) ( ) // expected-error {{cannot convert value of type '() -> Int?' to type '() -> Int' in coercion}}
You can’t perform that action at this time.
0 commit comments