Skip to content

Commit 0ce856b

Browse files
committed
Add a test for incorrectly constructing a Set from an NSArray
1 parent d595213 commit 0ce856b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/stdlib/NSSetAPI.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ NSSetAPI.test("AnyHashable containing NSSet that contains an NSSet") {
6767
}
6868
}
6969

70+
NSSetAPI.test("Incorrectly constructed Set for backwards compatibility") {
71+
let array:NSArray = [NSObject()] as NSArray
72+
let wrongSet = Set<NSObject>(_immutableCocoaSet: array)
73+
print(wrongSet.startIndex)
74+
}
75+
7076
var NSOrderedSetAPI = TestSuite("NSOrderedSetAPI")
7177

7278
NSOrderedSetAPI.test("Sequence") {

0 commit comments

Comments
 (0)