New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SR-5671] Compile failure for Type-Casting Pattern of Array downcasting #48241
Comments
This is strange. CodaFi (JIRA User), any insights? |
@swift-ci create |
This is the remnant of an ancient would-be feature that even extends to bridging the collection through Objective-C. It is converting the 'is' check into an as? check, but isn't including the comparator value so we're diagnosing it. I'm torn as to whether this can be removed altogether since it doesn't seem like it ever worked... |
More concerning to me is that asking the runtime [Dog]() is [Cat] returns true despite a diagnosis to the contrary:
|
I checked that the cast is not eliminated by the optimizer. Thus is must be an issue with the runtime. @jckarter could you have a look? |
At least to get the diagnostic QoI side of this #11441 |
A |
The runtime issue is unrelated to the switch issue. I just factored the 'is' check the pattern effectively performs into its own distinct expression
If covariance applied to this expression, we could derive a contradiction. |
Environment
Version 9.0 beta 4 (9M189t)
Apple Swift version 4.0 (swiftlang-900.0.54.11 clang-900.0.31)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: 6d61b5b6e53a73e776bbfc702cfae310
Issue Description:
results:
This should compile.
The text was updated successfully, but these errors were encountered: