We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 889ebaa commit 7b6b08bCopy full SHA for 7b6b08b
test/Casting/Casts.swift
@@ -847,4 +847,15 @@ CastsTests.test("Failing cast from Any to Optional<Protocol> [SR-6279]") {
847
expectNotNil(f)
848
}
849
850
+protocol SuperProtocol{}
851
+CastsTests.test("Casting Objects retained from KeyPaths to Protocols is not working properly") {
852
+ // This is the simplified reproduction from rdar://59844232 which doesn't
853
+ // actually use KeyPaths
854
+ class SubClass : SuperProtocol{}
855
+ let value = SubClass() as Any? as Any
856
+
857
+ expectNotNil(value as? SubClass)
858
+ expectNotNil(value as? SuperProtocol)
859
+}
860
861
runAllTests()
0 commit comments