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-10293] Fix-it for var parameter doesn't delete enough whitespace #52693

Closed
xedin opened this issue Apr 3, 2019 · 5 comments
Closed

[SR-10293] Fix-it for var parameter doesn't delete enough whitespace #52693

xedin opened this issue Apr 3, 2019 · 5 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers

Comments

@xedin
Copy link
Member

xedin commented Apr 3, 2019

Previous ID SR-10293
Radar rdar://problem/23571712
Original Reporter @xedin
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, StarterBug
Assignee slazarus (JIRA)
Priority Medium

md5: 91a0b3c7be8151ac2b93c6b92c8bb188

Issue Description:

Consider following example:

func foo(var arg: Int) {}

It produces correct diagnostic `error: 'var' as a parameter attribute is not allowed` with a fix-it to remove `var` but it doesn't remove enough trailing whilespace, so the result of applying fix-it looking like this:

func foo( arg: Int) {}
@swift-ci
Copy link
Collaborator

Comment by Sam Lazarus (JIRA)

@xedin I have a pull request up for this here #24059

@CodaFi
Copy link
Member

CodaFi commented Apr 16, 2019

Commenting here for some more visibility:

The answer here is to remove this diagnostic. It no longer makes sense to go to all this trouble to maintain a fixit from Swift 2. It can be replaced by a diagnostic that detects these keywords and offers to insert backticks around them. I suspect we have machinery to do this already, so the fix might be as simple as just removing the diagnostic and shuffling the tests.

@swift-ci
Copy link
Collaborator

Comment by Sam Lazarus (JIRA)

Resolved in #24059

@belkadan
Copy link
Contributor

slazarus (JIRA User) Don't forget to mark the bug as Resolved once the PR is merged!

@LucianoPAlmeida
Copy link
Collaborator

The PR was merged a long time ago, so this should be marked as resolved I think 🙂)

@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
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants