Skip to content

[SR-15657] Unimplemented computed property in enum is misdiagnosed as stored property #57936

@WowbaggersLiquidLunch

Description

@WowbaggersLiquidLunch
Previous ID SR-15657
Radar None
Original Reporter @WowbaggersLiquidLunch
Type Bug
Status Closed
Resolution Done
Environment

macOS 12.2 Beta (21D5025f)
Swift trunk development snapshot 2021-12-06

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

md5: d62063964d822e91a03f84e8d7bf8d49

Issue Description:

2 errors are produced for the following code:

enum E {
    // error 1: computed property must have accessors specified
    // error 2: enums must not contain stored properties
    var foo: Int {}
}

Only the error 1 is correct. Error 2 is incorrect.

Metadata

Metadata

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfdiagnostics QoIBug: Diagnostics Quality of Implementation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions