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-5674] Add fix-it for computed 'let' declaration #48244

Closed
rintaro mannequin opened this issue Aug 11, 2017 · 3 comments
Closed

[SR-5674] Add fix-it for computed 'let' declaration #48244

rintaro mannequin opened this issue Aug 11, 2017 · 3 comments
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

@rintaro
Copy link
Mannequin

rintaro mannequin commented Aug 11, 2017

Previous ID SR-5674
Radar None
Original Reporter @rintaro
Type Improvement
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, Parser, StarterBug
Assignee tonisuter (JIRA)
Priority Medium

md5: 8ada9c246e583dc4d977c6c88e2ff317

Issue Description:

let str: String { return "foo" }
error: 'let' declarations cannot be computed properties
let str: String { return "foo" }
                ^

It would be nice if the error has fix-it which replaces let with var

@rintaro
Copy link
Mannequin Author

rintaro mannequin commented Aug 11, 2017

This error is emitted in Parser::parseDeclVarGetSet.
To emit fix-it, you can propagate VarLoc (the location of let or var) from Parser::parseDeclVar to Parser::parseDeclVarGetSet.

@swift-ci
Copy link
Collaborator

Comment by Toni Suter (JIRA)

I would like to try to implement this fix-it.

@swift-ci
Copy link
Collaborator

Comment by Toni Suter (JIRA)

I submitted a pull request for this issue: #11527

@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

1 participant