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
nsd =[NSObject : AnyObject]() // expected-error {{cannot assign value of type '[NSObject : AnyObject]' to type 'NSDictionary'}}
153
+
nsd =[NSObject : AnyObject]()
154
154
nsd =[NSObject : AnyObject]()asNSDictionary
155
-
nsd =[NSObject : BridgedClass]() // expected-error {{cannot assign value of type '[NSObject : BridgedClass]' to type 'NSDictionary'}}
155
+
nsd =[NSObject : BridgedClass]()
156
156
nsd =[NSObject : BridgedClass]()asNSDictionary
157
-
nsd =[NSObject : OtherClass]() // expected-error {{cannot assign value of type '[NSObject : OtherClass]' to type 'NSDictionary'}}
157
+
nsd =[NSObject : OtherClass]()
158
158
nsd =[NSObject : OtherClass]()asNSDictionary
159
-
nsd =[NSObject : BridgedStruct]() // expected-error {{cannot assign value of type '[NSObject : BridgedStruct]' to type 'NSDictionary'}}
159
+
nsd =[NSObject : BridgedStruct]()
160
160
nsd =[NSObject : BridgedStruct]()asNSDictionary
161
161
nsd =[NSObject : NotBridgedStruct]() // expected-error{{cannot assign value of type '[NSObject : NotBridgedStruct]' to type 'NSDictionary'}}
162
162
nsd =[NSObject : NotBridgedStruct]()asNSDictionary // expected-error{{cannot convert value of type '[NSObject : NotBridgedStruct]' to type 'NSDictionary' in coercion}}
nsd =[NSObject : BridgedStruct?]() // expected-error{{cannot assign value of type '[NSObject : BridgedStruct?]' to type 'NSDictionary'}}
167
167
nsd =[NSObject : BridgedStruct?]()asNSDictionary //expected-error{{cannot convert value of type '[NSObject : BridgedStruct?]' to type 'NSDictionary' in coercion}}
168
168
169
-
nsd =[BridgedClass : AnyObject]() // expected-error {{cannot assign value of type '[BridgedClass : AnyObject]' to type 'NSDictionary'}}
169
+
nsd =[BridgedClass : AnyObject]()
170
170
nsd =[BridgedClass : AnyObject]()asNSDictionary
171
-
nsd =[OtherClass : AnyObject]() // expected-error {{cannot assign value of type '[OtherClass : AnyObject]' to type 'NSDictionary'}}
171
+
nsd =[OtherClass : AnyObject]()
172
172
nsd =[OtherClass : AnyObject]()asNSDictionary
173
-
nsd =[BridgedStruct : AnyObject]() // expected-error {{cannot assign value of type '[BridgedStruct : AnyObject]' to type 'NSDictionary'}}
173
+
nsd =[BridgedStruct : AnyObject]()
174
174
nsd =[BridgedStruct : AnyObject]()asNSDictionary
175
175
nsd =[NotBridgedStruct : AnyObject]() // expected-error{{cannot assign value of type '[NotBridgedStruct : AnyObject]' to type 'NSDictionary'}}
176
176
nsd =[NotBridgedStruct : AnyObject]()asNSDictionary // expected-error{{cannot convert value of type '[NotBridgedStruct : AnyObject]' to type 'NSDictionary' in coercion}}
177
177
178
178
// <rdar://problem/17134986>
179
179
varbcOpt:BridgedClass?
180
-
nsd =[BridgedStruct(): bcOpt] // expected-error{{value of type 'BridgedStruct' does not conform to expected dictionary key type 'NSCopying'}}
180
+
nsd =[BridgedStruct(): bcOpt] // expected-error{{value of optional type 'BridgedClass?' not unwrapped; did you mean to use '!' or '?'?}}
181
181
bcOpt =nil
182
182
_ = nsd
183
183
}
@@ -233,7 +233,7 @@ func rdar19695671() {
233
233
// This failed at one point while fixing rdar://problem/19600325.
// <rdar://problem/20029786> Swift compiler sometimes suggests changing "as!" to "as?!"
294
294
func rdar20029786(_ ns:NSString?){
295
-
vars:String= ns ??"str"asStringasString // expected-error{{cannot convert value of type 'NSString?' to expected argument type 'String?'}}
296
-
vars2= ns ??"str"asStringasString // expected-error {{binary operator '??' cannot be applied to operands of type 'NSString?' and 'String'}} expected-note{{}}
295
+
vars:String= ns ??"str"asStringasString // expected-error{{'NSString' is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?}}
296
+
vars2= ns ??"str"asStringasString
297
297
298
-
lets3:NSString?="str"asString? // expected-error {{cannot convert value of type 'String?' to specified type 'NSString?'}}
298
+
lets3:NSString?="str"asString?
299
299
300
300
vars4:String= ns ??"str" // expected-error{{'NSString' is not implicitly convertible to 'String'; did you mean to use 'as' to explicitly convert?}}{{20-20=(}}{{31-31=) as String}}
301
301
vars5:String=(ns ??"str")asString // fixed version
0 commit comments