Skip to content

Commit

Permalink
Merge pull request swiftlang#2874 from readdle/test-dynamic-cast
Browse files Browse the repository at this point in the history
Add failing test for dynamic cast
  • Loading branch information
compnerd authored Sep 14, 2020
2 parents 7475bdf + 4c70434 commit dc881a8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Tests/Foundation/Tests/TestBridging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class TestBridging : XCTestCase {
static var allTests: [(String, (TestBridging) -> () throws -> Void)] {
return [
("testBridgedDescription", testBridgedDescription),
("testDynamicCast", testDynamicCast),
]
}

Expand Down Expand Up @@ -62,4 +63,11 @@ class TestBridging : XCTestCase {
XCTAssertEqual("description", c.debugDescription)
#endif
}

func testDynamicCast() throws {
// Covers https://github.com/apple/swift-corelibs-foundation/pull/2500
class TestClass {}
let anyArray: Any = [TestClass()]
XCTAssertNotNil(anyArray as? NSObject)
}
}

0 comments on commit dc881a8

Please sign in to comment.