Skip to content

Diagnose if a number is used in place of an identifier #941

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
merged 1 commit into from
Oct 13, 2022

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 13, 2022

No description provided.

@ahoppen ahoppen requested a review from bnbarham October 13, 2022 17:18
@ahoppen
Copy link
Member Author

ahoppen commented Oct 13, 2022

@swift-ci Please test

@ahoppen ahoppen merged commit ee10cb1 into swiftlang:main Oct 13, 2022
@ahoppen ahoppen deleted the ahoppen/number-as-identifier branch October 13, 2022 19:51
@@ -690,8 +690,8 @@ final class DeclarationTests: XCTestCase {
}
""",
diagnostics: [
DiagnosticSpec(locationMarker: "1️⃣", message: "identifier can only start with a letter or underscore, not a number"),
DiagnosticSpec(locationMarker: "2️⃣", message: "identifier can only start with a letter or underscore, not a number"),
DiagnosticSpec(locationMarker: "1️⃣", message: "name can only start with a letter or underscore, not a number"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As in the other PR, IMO identifier is more descriptive than name here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once I’ve merged my PR backlog, I will set up a PR that checks what happens if we remove the name_for_diagnostics. It’s probably easiest to discuss all the implications this has on there.

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.

2 participants