Skip to content

Commit 4c70434

Browse files
committed
Add test for dynamic cast issue from swiftlang#2500
1 parent abb1349 commit 4c70434

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Tests/Foundation/Tests/TestBridging.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class TestBridging : XCTestCase {
2626
static var allTests: [(String, (TestBridging) -> () throws -> Void)] {
2727
return [
2828
("testBridgedDescription", testBridgedDescription),
29+
("testDynamicCast", testDynamicCast),
2930
]
3031
}
3132

@@ -62,4 +63,11 @@ class TestBridging : XCTestCase {
6263
XCTAssertEqual("description", c.debugDescription)
6364
#endif
6465
}
66+
67+
func testDynamicCast() throws {
68+
// Covers https://github.com/apple/swift-corelibs-foundation/pull/2500
69+
class TestClass {}
70+
let anyArray: Any = [TestClass()]
71+
XCTAssertNotNil(anyArray as? NSObject)
72+
}
6573
}

0 commit comments

Comments
 (0)