Skip to content

Commit 067beb1

Browse files
committed
Accessing nil-keyed elements is trickier than I thought
1 parent 5aaabfd commit 067beb1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/Casting/Casts.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ CastsTests.test("Optional cast to AnyHashable") {
901901
expectNil(d6)
902902

903903
// In both Swift 5.3 and 5.4, the nil key should be preserved and still function
904-
let d7 = d2[nil]
904+
let d7 = d2[String?.none as AnyHashable]
905905
expectNotNil(d7)
906906

907907
// Direct casts via the runtime unwrap the optional in 5.3 but not 5.4.

0 commit comments

Comments
 (0)