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-14539] Swift 5.5 errors on enum cases with associated values being marked available #56891

Closed
adam-fowler opened this issue Apr 27, 2021 · 2 comments

Comments

@adam-fowler
Copy link

Previous ID SR-14539
Radar rdar://problem/77222685
Original Reporter @adam-fowler
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 7
Component/s
Labels Improvement
Assignee None
Priority Medium

md5: 1f2e679814542971c6cf307547fbd455

Issue Description:

With latest swift, this will not compile anymore

public enum TSTLSOptions {
    @available(macOS 10.14, iOS 12, tvOS 12, *)
    case some(NWProtocolTLS.Options)
    case none
} 

It used to.

I believe the change that broke this is 511ada4

From the comments in the change it seems to imply this would not be an issue if the associated value was a class reference or @Frozen. Is it possible to not have this error in those cases?

This was found in swift snapshot 2021-04-18

@typesanitizer
Copy link

@swift-ci create

@slavapestov
Copy link
Member

This is working as intended. We do not support conditionally-available enum cases. You either need to make the entire enum @available, or bump the deployment target.

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

No branches or pull requests

3 participants