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-7844] Error message for a subscript without accessors says "computed property" #50380

Closed
belkadan opened this issue Jun 1, 2018 · 1 comment
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 Jun 1, 2018

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

md5: b407676a422a443e25c49bc40cb4b709

Issue Description:

struct Test {
  subscript(index: Int) -> Int {
  }
}
<stdin>:3:3: error: computed property must have accessors specified
  }
  ^

This is a subscript, not a computed property. The diagnostic should be changed to reflect that. (The best way to do this is probably using the %select feature of Swift diagnostics, not defining two separate diagnostics.)

@belkadan
Copy link
Contributor Author

enomotok (JIRA User) implemented this in #17075

@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