-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Parse] Support #if swift(<4.1)
#14503
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
Conversation
@swift-ci Please smoke test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! Please include some tests that do not come out true, as well as at least one that uses !
.
cc @rintaro for any additional comments
@@ -28,3 +28,30 @@ | |||
asdf asdf asdf asdf | |||
#endif | |||
|
|||
#if swift(<5) | |||
let a = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To future-proof these tests, I think the conditions should be such that asdf asdf asdf asdf
emits no diagnostics in an #if
branch which is never executed--for example, #if swift(<4)
.
It's a language change. I think the Core Team could approve this without a review by acclamation, but it should at least be given the opportunity to formally say that. |
#endif | ||
|
||
#if swift(<4.1.9) | ||
let d = 1 | ||
#if swift(<10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a five-year time bomb. Why not Swift 99?
Implementation itself looks good :) |
Reimplemented in #17960 |
Add the ability to specify conditional compilation using
<
in addition to the currently supported>=
unary prefix.#if swift(<4.1)
is equivalent to#if !swift(>=4.1)
.Resolves #49401.