@@ -1386,9 +1386,9 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.DictionaryIsCopied") {
1386
1386
}
1387
1387
1388
1388
// Delete the key from the NSMutableDictionary.
1389
- assert ( nsd [ TestBridgedKeyTy ( 10 ) ] != nil )
1390
- nsd. removeObject ( forKey: TestBridgedKeyTy ( 10 ) )
1391
- assert ( nsd [ TestBridgedKeyTy ( 10 ) ] == nil )
1389
+ assert ( nsd [ TestBridgedKeyTy ( 10 ) as NSCopying ] != nil )
1390
+ nsd. removeObject ( forKey: TestBridgedKeyTy ( 10 ) as NSCopying )
1391
+ assert ( nsd [ TestBridgedKeyTy ( 10 ) as NSCopying ] == nil )
1392
1392
1393
1393
// Find an existing key, again.
1394
1394
do {
@@ -1856,7 +1856,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.RemoveAt") {
1856
1856
let removedElement = d. remove ( at: foundIndex1)
1857
1857
assert ( identity1 == unsafeBitCast ( d, to: Int . self) )
1858
1858
assert ( isNativeDictionary ( d) )
1859
- assert ( removedElement. 0 == TestObjCKeyTy ( 10 ) )
1859
+ assert ( removedElement. 0 == TestObjCKeyTy ( 10 ) as TestBridgedKeyTy )
1860
1860
assert ( removedElement. 1 . value == 1010 )
1861
1861
assert ( d. count == 2 )
1862
1862
assert ( d. index ( forKey: TestBridgedKeyTy ( 10 ) ) == nil )
@@ -2913,11 +2913,11 @@ DictionaryTestSuite.test("DictionaryToNSDictionaryConversion") {
2913
2913
d [ TestObjCKeyTy ( 10 ) ] = TestObjCValueTy ( 1010 )
2914
2914
d [ TestObjCKeyTy ( 20 ) ] = TestObjCValueTy ( 1020 )
2915
2915
d [ TestObjCKeyTy ( 30 ) ] = TestObjCValueTy ( 1030 )
2916
- let nsd : NSDictionary = d
2916
+ let nsd : NSDictionary = d as NSDictionary
2917
2917
2918
2918
checkDictionaryFastEnumerationFromSwift (
2919
2919
[ ( 10 , 1010 ) , ( 20 , 1020 ) , ( 30 , 1030 ) ] ,
2920
- d, { d } ,
2920
+ d as NSDictionary , { d as NSDictionary } ,
2921
2921
{ ( $0 as! TestObjCKeyTy ) . value } ,
2922
2922
{ ( $0 as! TestObjCValueTy ) . value } )
2923
2923
@@ -3824,13 +3824,13 @@ DictionaryTestSuite.test("dropsBridgedCache") {
3824
3824
// This test will only fail in address sanitizer.
3825
3825
var dict = [ 0 : 10 ]
3826
3826
do {
3827
- var bridged : NSDictionary = dict
3827
+ var bridged : NSDictionary = dict as NSDictionary
3828
3828
expectEqual ( 10 , bridged [ 0 ] as! Int )
3829
3829
}
3830
3830
3831
3831
dict [ 0 ] = 11
3832
3832
do {
3833
- var bridged : NSDictionary = dict
3833
+ var bridged : NSDictionary = dict as NSDictionary
3834
3834
expectEqual ( 11 , bridged [ 0 ] as! Int )
3835
3835
}
3836
3836
}
0 commit comments