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-3663] Successful '||' ignores rest of expression in conditional compilation directive #46248

Closed
rintaro mannequin opened this issue Jan 18, 2017 · 2 comments
Closed
Assignees
Labels
accepts invalid Bug: Accepts invalid bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself parser Area → compiler: The legacy C++ parser

Comments

@rintaro
Copy link
Mannequin

rintaro mannequin commented Jan 18, 2017

Previous ID SR-3663
Radar rdar://21692106
Original Reporter @rintaro
Type Bug
Status Resolved
Resolution Done
Environment

Xcode Version 8.2.1 (8C1002)
Apple Swift version 3.0.2 (swiftlang-800.0.63 clang-800.0.42.1)
Target: x86_64-apple-macosx10.9

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, AcceptsInvalid, Parser
Assignee @rintaro
Priority Medium

md5: 7097303969b0da5727e851a9bfec453c

relates to:

  • SR-3455 Evaluation and Validation of Build Conditions Should Be Separate

Issue Description:

This code compiles, and prints true.

#if false || true && os(99.0) || Whoops (try Anything) is OK?
print(true)
#endif

Even if the syntax is OK, this is evaluated to true

#if false || true && false
print(true)
#endif

Two problems here:

  • Precedence of && should be higher than ||.

  • Whole syntax should be validated even if || expression is resulted to success.

@belkadan
Copy link
Contributor

*sigh* And of course these would both be source-breaking changes.

@rintaro
Copy link
Mannequin Author

rintaro mannequin commented May 19, 2017

#7955

@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
accepts invalid Bug: Accepts invalid bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself parser Area → compiler: The legacy C++ parser
Projects
None yet
Development

No branches or pull requests

1 participant