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-2709] @available(swift N) to match -swift-version N #45313

Closed
swift-ci opened this issue Sep 21, 2016 · 3 comments
Closed

[SR-2709] @available(swift N) to match -swift-version N #45313

swift-ci opened this issue Sep 21, 2016 · 3 comments
Labels
compiler The Swift compiler in itself improvement

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-2709
Radar rdar://problem/30034329
Original Reporter graydon (JIRA User)
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement
Assignee graydon (JIRA)
Priority Medium

md5: 70a882de5a4a030863b28ba3fa99ae94

Issue Description:

The recently-added -swift-version N flag in SR-2582 only affects the #if swift(>=N) compiler-control statements, which is not sufficient for shipping a library with parts that are unconditionally compiled but conditionally available. For the latter, we need to support something like @available(swift N) similar to the platform availability tests.

The exact semantics are a bit subtle; as far as I can tell, swift-version unavailability should override platform availability, but swift-version availability should not override platform unavailability. That is, swift-version availability should be considered in conjunction, not disjunction, with platform availability. We don't exactly have a way to write availability conjuncts at the moment, so as an initial implementation we might just prohibit combining `@available(swift N)` with any other platform-availability spec in the same attribute argument list.

Other suggestions welcome!

@swift-ci
Copy link
Collaborator Author

Comment by Graydon Hoare (JIRA)

Proposal under review in https://lists.swift.org/pipermail/swift-evolution-announce/2016-September/000286.html

Preliminary implementation is available #4985

@swift-ci
Copy link
Collaborator Author

swift-ci commented Nov 9, 2016

Comment by Graydon Hoare (JIRA)

Merged 28b13a1

@swift-ci
Copy link
Collaborator Author

Comment by Myke Olson (JIRA)

@swift-ci create

@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
compiler The Swift compiler in itself improvement
Projects
None yet
Development

No branches or pull requests

1 participant