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
// <rdar://problem/20029786> Swift compiler sometimes suggests changing "as!" to "as?!"
287
287
func rdar20029786(_ ns:NSString?){
288
-
vars:String= ns ??"str"asStringasString // expected-error{{'NSString' is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?}} {{19-19=(}} {{50-50=) as String}}
288
+
vars:String= ns ??"str"asStringasString // expected-error{{'NSString' is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?}} {{19-19=(}} {{50-50=) as String}} expected-warning {{redundant cast to 'String' has no effect}} {{41-51=}}
289
289
// expected-error@-1 {{cannot convert value of type 'String' to expected argument type 'NSString'}} {{50-50= as NSString}}
290
290
vars2= ns ??"str"asStringasString // expected-error {{cannot convert value of type 'String' to expected argument type 'NSString'}}{{43-43= as NSString}} expected-warning {{redundant cast to 'String' has no effect}} {{34-44=}}
0 commit comments