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-11903] SE-0192 - Frozen enums imported from ObjC can still be initted with invalid rawValues #54320

Open
swift-ci opened this issue Dec 5, 2019 · 1 comment
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

swift-ci commented Dec 5, 2019

Previous ID SR-11903
Radar rdar://problem/57711776
Original Reporter ultramiraculous (JIRA User)
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug
Assignee None
Priority Medium

md5: 99c656495cc5a924a9caa22546e8d9d3

Issue Description:

SR-1419 / SR-8894 documented this previously and were closed as intended behavior until SE-0192 was done.

In the section on C enums in SE-0192 it's mentioned that adding the `frozen` concept to the language would enable Swift to drop the `init(rawValue🙂` constructor behavior on imported enums that allows invalid values:

Apart from the effect on switches, a frozen C enum's init(rawValue:) will also enforce that the case is one of those known at compile time. Imported non-frozen enums will continue to perform no checking on the raw value.
@beccadax
Copy link
Contributor

beccadax commented Dec 6, 2019

@swift-ci create

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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