Skip to content
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-4376] Casting an existential to another existential type for a protocol in a different module erroneously 'always succeeds' #46955

Closed
jckarter opened this issue Mar 27, 2017 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@jckarter
Copy link
Member

Previous ID SR-4376
Radar rdar://problem/31301668
Original Reporter @jckarter
Type Bug
Status Closed
Resolution Duplicate
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, 3.1Regression
Assignee @jckarter
Priority Medium

md5: 845727455a98c5f9f5a00b35c6507e69

duplicates:

  • SR-4377 Swift 3.1 regression with conditional casting to protocol

Issue Description:

https://twitter.com/NachoSoto/status/846465974156984320

— module A:
protocol R: Error {}
— module B:
enum E: Error, R { case a }
— module C:
let e: Error = E.a
let _: R? = e as? R

The cast is improperly flagged as always succeeding.

@jckarter
Copy link
Member Author

@swift-ci create

@NachoSoto
Copy link
Contributor

You beat me to it: https://bugs.swift.org/browse/SR-4377

@jckarter
Copy link
Member Author

Oops, I'll dup mine to yours.

@NachoSoto
Copy link
Contributor

Thanks!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

2 participants