You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
completion(t) // expected-error {{cannot convert value of type 'diagnostics.SR_12242_R<[diagnostics.SR_12242_T]>' to expected argument type 'diagnostics.SR_12242_R<[SR_12242_T]>'}}
1430
1430
// expected-note@-1 {{arguments to generic parameter 'Element' ('diagnostics.SR_12242_T' and 'SR_12242_T') are expected to be equal}}
1431
1431
}
1432
+
1433
+
func assignGenericMismatch(){
1434
+
vara:[Int]?
1435
+
varb:[String]
1436
+
1437
+
a = b // expected-error {{cannot assign value of type '[String]' to type '[Int]?'}}
1438
+
// expected-note@-1 {{arguments to generic parameter 'Element' ('String' and 'Int') are expected to be equal}}
1439
+
1440
+
b = a // expected-error {{cannot assign value of type '[Int]' to type '[String]'}}
1441
+
// expected-note@-1 {{arguments to generic parameter 'Element' ('Int' and 'String') are expected to be equal}}
1442
+
// expected-error@-2 {{value of optional type '[Int]?' must be unwrapped to a value of type '[Int]'}}
1443
+
// expected-note@-3 {{coalesce using '??' to provide a default when the optional value contains 'nil'}}
1444
+
// expected-note@-4 {{force-unwrap using '!' to abort execution if the optional value contains 'nil'}}
0 commit comments