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-4516] Something goes badly wrong with enum to protocol casting #47093

Closed
iby opened this issue Apr 6, 2017 · 4 comments
Closed

[SR-4516] Something goes badly wrong with enum to protocol casting #47093

iby opened this issue Apr 6, 2017 · 4 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@iby
Copy link

iby commented Apr 6, 2017

Previous ID SR-4516
Radar None
Original Reporter @iby
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee @tbkka
Priority Medium

md5: caeb040fa8113d028f7c0142618f8e29

duplicates:

  • SR-3871 Protocol passing via objective-c / Any can't be cast back to protocol type

Issue Description:

Swift fails to cast enum into protocol passed into NSViewController as represented object, but successfully casts classes into the same protocol. Below example illustrates the issue.

@belkadan
Copy link
Contributor

belkadan commented Apr 6, 2017

@jckarter, I think we just saw one like this? We don't cast back to the value type before checking for protocol conformance?

@jckarter
Copy link
Member

jckarter commented Apr 6, 2017

Yeah, this looks like a dup of SR-3871.

@tbkka
Copy link
Contributor

tbkka commented Jan 15, 2020

This was closed as a dup of SR-3871, but the current implementation actually uses different code paths for these cases. Re-opening and assigning it to myself so I can track these various related dynamic casting issues.

@tbkka
Copy link
Contributor

tbkka commented Jan 29, 2020

Ah. It really is a dupe of SR-3871. Closing again.

@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.
Projects
None yet
Development

No branches or pull requests

4 participants