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-6852] Support #if swift(<4.1) #49401

Closed
belkadan opened this issue Jan 26, 2018 · 2 comments
Closed

[SR-6852] Support #if swift(<4.1) #49401

belkadan opened this issue Jan 26, 2018 · 2 comments
Labels
compiler directives Feature: compiler directives (#if, #warning, #error, etc.) compiler The Swift compiler in itself feature A feature request or implementation good first issue Good for newcomers improvement swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented

Comments

@belkadan
Copy link
Contributor

Previous ID SR-6852
Radar None
Original Reporter @belkadan
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 2
Component/s Compiler
Labels Improvement, StarterBug, StarterProposal
Assignee hashemi (JIRA)
Priority Medium

md5: d6504962ca1a564793f5327cd6c0afb5

Issue Description:

swift(>=x.y) is a special compilation condition that controls whether part of a file is even parsed, because the language may change between versions. Because of this, there's a restriction that it can't be combined with other compilation conditions, which still check that the inactive block of the #if parses correctly. However, there's nothing wrong with `#if !swift(>=4.1)`, and therefore it would be reasonable to support spelling that directly, `#if swift(<4.1)`.

(Note that it would not make sense to check for swift(>x.y) or swift(<=x.y), since that makes a statement about future releases rather than present releases. For example, even when 4.1.0 is officially released, that wouldn't preclude another release from the 4.0 branch, 4.0.4.)

@swift-ci
Copy link
Collaborator

swift-ci commented Feb 9, 2018

Comment by Ahmad Alhashemi (JIRA)

Submitted an implementation in PR-14503

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented and removed StarterProposal labels Nov 11, 2022
@AnthonyLatsis
Copy link
Collaborator

Proposal: SE-0224

@AnthonyLatsis AnthonyLatsis added the feature A feature request or implementation label Nov 12, 2022
@AnthonyLatsis AnthonyLatsis added the compiler directives Feature: compiler directives (#if, #warning, #error, etc.) label Nov 8, 2023
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler directives Feature: compiler directives (#if, #warning, #error, etc.) compiler The Swift compiler in itself feature A feature request or implementation good first issue Good for newcomers improvement swift evolution implemented Flag → feature: A feature that was approved through the Swift evolution process and implemented
Projects
None yet
Development

No branches or pull requests

3 participants