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-3167] Improve error when using keywords as identifiers #45755

Closed
belkadan opened this issue Nov 9, 2016 · 4 comments
Closed

[SR-3167] Improve error when using keywords as identifiers #45755

belkadan opened this issue Nov 9, 2016 · 4 comments
Assignees
Labels
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers improvement parser Area → compiler: The legacy C++ parser

Comments

@belkadan
Copy link
Contributor

belkadan commented Nov 9, 2016

Previous ID SR-3167
Radar rdar://problem/25881880
Original Reporter @belkadan
Type Improvement
Status Closed
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, Parser, StarterBug
Assignee @belkadan
Priority Medium

md5: dfc0ab758b4f132463ad177824c23f7f

Issue Description:

func switch() { }
repl.swift:1:6: error: expected identifier in function declaration
func switch() { }
     ^

We can do better than this. Someone inside Apple suggested "keyword 'switch' found where an identifier should be in a function's name. Try picking a different name for the function or putting backticks (`) around the name." The suggested fixes (the second sentence) should probably be two separate notes rather than crammed into the main diagnostic.

@robinkunde
Copy link
Contributor

Accidentally closed the wrong issue.

@robinkunde
Copy link
Contributor

PR submitted: #6045

@belkadan
Copy link
Contributor Author

belkadan commented Dec 5, 2016

Ah, for the future, please don't mark bugs as Resolved until the PR is merged.

@robinkunde
Copy link
Contributor

Ok.

@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
compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers improvement parser Area → compiler: The legacy C++ parser
Projects
None yet
Development

No branches or pull requests

2 participants