-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Lex] Reject standalone dollars as identifiers #3901
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. |
Now it becomes an unknown token instead.
5dd16b6
to
389f779
Compare
@swift-ci please smoke test. |
@swift-ci please smoke test Linux platform. |
Let's see if we can't get Linux green again? @swift-ci please smoke test Linux platform. |
I want to land this clean @swift-ci please smoke test Linux platform. |
Should this be included in the Swift 3 branch? cc @tkremenek |
This is source breaking, right? |
Source breaking changes should wait until we have a framework to support them. Also, $ is commonly used by dollar.swift, so I'd suggest a targeted fixme that rewrites the $ to a valid identifier, e.g. "💲" (yes, I'm serious). This will allow the migrator Swift 3->4 migrator to handle the framework. |
Related proposal that's been waiting for a long time to be merged/closed: swiftlang/swift-evolution#354 |
(I'm working with others on a proposal to refine the operator/identifier characters — there's been some interest in including |
What does "a framework to support them" mean? Aren't source-breaking changes encouraged to happen ASAP (3.0.1 or 3.1) so we can avoid them in the future? |
We already passed that deadline: it was 3.0. At this point source-breaking changes need to be justified and will be handled on a case-by-case basis. |
…but the process for doing this hasn't been decided and written up yet. |
I see. And is the swift 3 branch still being used for 3.1? (Sorry for hijacking this PR thread...) |
Most likely no, we will rebranch there. (Which may mean downgrading this to a warning.) |
We discussed this topic today in the core team. Here are some specific requests:
As to deciding the fate of single $ identifiers, I'm working with a swift-evolution proposal to run this topic by the community. That could possibly lead to backtracking on our rejection of $, but in the meantime we should still reject it the right way. Thanks @CodaFi! |
Sigh, please fixit this from |
Maybe this is how you spell it in markdown?? |
OMG, I win! :-) |
|
Resolve conflicts with upstream `main`
What's in this pull request?
Fixes a case where we accidentally accepted a single dollar as an identifier. This patch supersedes #3004.
Resolved bug number: (SR-1661)
Before merging this pull request to apple/swift repository:
Triggering Swift CI
The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:
Smoke Testing
A smoke test on macOS does the following:
device standard libraries are not built.
version of these tests are not run.
A smoke test on Linux does the following:
tests are not run.
Validation Testing
Lint Testing
Note: Only members of the Apple organization can trigger swift-ci.