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-15297] Inaccurate error message for 'let' properties in protocol declaration #57619

Open
WowbaggersLiquidLunch opened this issue Oct 8, 2021 · 1 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

Comments

@WowbaggersLiquidLunch
Copy link
Collaborator

Previous ID SR-15297
Radar None
Original Reporter @WowbaggersLiquidLunch
Type Bug
Environment

macOS 12.0 Beta (21A5543b)
Swift 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1) and Swift development snapshot 2021-09-28

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI
Assignee None
Priority Medium

md5: 20b48ba2536750897582696544ef4fa9

Issue Description:

protocol Foo {
    let x: Bar
    // error: 'let' declarations cannot be computed properties
    // fix-it: replace 'let' with 'var'
}

This error message is inaccurate. I think “‘let' declarations cannot be in protocol declaration” is better.

@WowbaggersLiquidLunch
Copy link
Collaborator Author

Didn't look very deep into this, but I think this `if` statement will need a new case for when the let is in a protocol declaration:

if (PrimaryVar->isLet() && !Attributes.hasAttribute<HasStorageAttr>()) {

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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
Projects
None yet
Development

No branches or pull requests

1 participant