Skip to content

Commit ca1b525

Browse files
committed
Update another test for explicit bridging conversions.
1 parent a7895c9 commit ca1b525

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: validation-test/stdlib/Dictionary.swift

+8-8
Original file line numberDiff line numberDiff line change
@@ -1386,9 +1386,9 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.DictionaryIsCopied") {
13861386
}
13871387

13881388
// 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)
13921392

13931393
// Find an existing key, again.
13941394
do {
@@ -1856,7 +1856,7 @@ DictionaryTestSuite.test("BridgedFromObjC.Nonverbatim.RemoveAt") {
18561856
let removedElement = d.remove(at: foundIndex1)
18571857
assert(identity1 == unsafeBitCast(d, to: Int.self))
18581858
assert(isNativeDictionary(d))
1859-
assert(removedElement.0 == TestObjCKeyTy(10))
1859+
assert(removedElement.0 == TestObjCKeyTy(10) as TestBridgedKeyTy)
18601860
assert(removedElement.1.value == 1010)
18611861
assert(d.count == 2)
18621862
assert(d.index(forKey: TestBridgedKeyTy(10)) == nil)
@@ -2913,11 +2913,11 @@ DictionaryTestSuite.test("DictionaryToNSDictionaryConversion") {
29132913
d[TestObjCKeyTy(10)] = TestObjCValueTy(1010)
29142914
d[TestObjCKeyTy(20)] = TestObjCValueTy(1020)
29152915
d[TestObjCKeyTy(30)] = TestObjCValueTy(1030)
2916-
let nsd: NSDictionary = d
2916+
let nsd: NSDictionary = d as NSDictionary
29172917

29182918
checkDictionaryFastEnumerationFromSwift(
29192919
[ (10, 1010), (20, 1020), (30, 1030) ],
2920-
d, { d },
2920+
d as NSDictionary, { d as NSDictionary },
29212921
{ ($0 as! TestObjCKeyTy).value },
29222922
{ ($0 as! TestObjCValueTy).value })
29232923

@@ -3824,13 +3824,13 @@ DictionaryTestSuite.test("dropsBridgedCache") {
38243824
// This test will only fail in address sanitizer.
38253825
var dict = [0:10]
38263826
do {
3827-
var bridged: NSDictionary = dict
3827+
var bridged: NSDictionary = dict as NSDictionary
38283828
expectEqual(10, bridged[0] as! Int)
38293829
}
38303830

38313831
dict[0] = 11
38323832
do {
3833-
var bridged: NSDictionary = dict
3833+
var bridged: NSDictionary = dict as NSDictionary
38343834
expectEqual(11, bridged[0] as! Int)
38353835
}
38363836
}

0 commit comments

Comments
 (0)