[SR-2146] Crash when @objc protocol existential is cast to another type and back in generic context #44754
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
crash
Bug: A crash, i.e., an abnormal termination of software
run-time crash
Bug → crash: Swift code crashed during execution
Environment
Swift 2.2
Additional Detail from JIRA
md5: f13672703fe6c8f14099dcba6e9aeb7b
Issue Description:
The following crashes with the error "Could not cast value of type 'SwiftObjCProtocolBug.Test' (0x1002c6988) to 'SwiftObjCProtocolBug.Foo' (0x1005fd040)."
Workaround: Add a redundant conformance to `Foo` when `Test` is declared. Oddly, the compiler doesn't warn us about this. Note that the redundant conformance cannot be added in an extension due to SR-2078.
The text was updated successfully, but these errors were encountered: