Skip to content

[Parse] Fix crash in conditional compilation parsing #7331

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

Merged

Conversation

jtbandes
Copy link
Contributor

@jtbandes jtbandes commented Feb 8, 2017

Cleans up some diagnostics and fixes a crasher reported by @practicalswift in https://twitter.com/practicalswift/status/829066902869786625.

Also, this is now disallowed (it seemed to be allowed only unintentionally):

#if x &&
y
#endif

@jtbandes
Copy link
Contributor Author

jtbandes commented Feb 8, 2017

@swift-ci please smoke test

@jtbandes jtbandes force-pushed the stability-should-be-unconditional branch from 3265417 to db2b7c2 Compare February 8, 2017 07:55
@jtbandes
Copy link
Contributor Author

jtbandes commented Feb 8, 2017

@swift-ci please smoke test

@rintaro
Copy link
Member

rintaro commented Feb 8, 2017

This is technically a source breaking change. 😢
In Xcode8.2:

#if true && true &&
    print("ok")
#endif

does compile, and prints "ok". (since it's no-assert build)

related https://bugs.swift.org/browse/SR-3663

@jtbandes
Copy link
Contributor Author

jtbandes commented Feb 8, 2017

That's true. It might be pretty easy to keep the old behavior in Swift 3 mode. I would be interested to hear what @DougGregor thinks about whether it's important...

@DougGregor
Copy link
Member

I don't consider that source-break important. The likelihood of this affecting real-world code is small, and that code is obviously invalid. PR LGTM, thanks!

@jtbandes jtbandes force-pushed the stability-should-be-unconditional branch from db2b7c2 to 5c4185a Compare February 9, 2017 06:37
@jtbandes
Copy link
Contributor Author

jtbandes commented Feb 9, 2017

@swift-ci please smoke test

@jtbandes jtbandes merged commit e1fd8aa into swiftlang:master Feb 9, 2017
@jtbandes jtbandes deleted the stability-should-be-unconditional branch February 9, 2017 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants