-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationgood first issueGood for newcomersGood for newcomersparserArea → compiler: The legacy C++ parserArea → compiler: The legacy C++ parser
Description
| Previous ID | SR-2354 |
| Radar | None |
| Original Reporter | chriseidhof (JIRA User) |
| Type | Bug |
| Status | Resolved |
| Resolution | Done |
Additional Detail from JIRA
| Votes | 0 |
| Component/s | Compiler |
| Labels | Bug, DiagnosticsQoI, Parser, StarterBug |
| Assignee | @CodaFi |
| Priority | Medium |
md5: 0bbd574dd373c16d9585687e14bb250e
Issue Description:
When I try to have an `inout` parameter in a subscript, the compiler won't let me compile:
struct X {
subscript(x: inout Int) -> () {
x += 1
}
}
However, the error message could be improved. The current message is: "Parameters may not have the 'var' specifier". This should probably be something like "Subscript parameters may not have the 'inout' specifier".
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationgood first issueGood for newcomersGood for newcomersparserArea → compiler: The legacy C++ parserArea → compiler: The legacy C++ parser