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-8515] Compiler should show error for ambiguous enum cases with implicit casting #51035

Closed
swift-ci opened this issue Aug 10, 2018 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-8515
Radar None
Original Reporter buscarini (JIRA User)
Type Bug
Status Closed
Resolution Duplicate
Environment

Swift 4.1. Xcode 9.4.1 (9F2000)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 68ab709c536ebb2fa5115f5c16020a6d

duplicates:

  • SR-2176 Add warning for ambiguous enum value assignment

Issue Description:

I've recently had trouble with UITableViewCellSelectionStyle. I have a function that accepts an optional UITableViewCellSelectionStyle. Optional has a "none" case, and "UITableViewCellSelectionStyle" too. This means that passing a .none is ambiguous (due to implicit casting to optional), as it could be interpreted as a nil value or a .some(.none). I think the best solution here would be to show an error if there is ambiguity.

@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

1 participant