Skip to content

Parser error for final get #75933

Open
Open
@AnthonyLatsis

Description

@AnthonyLatsis

Description

We have a bespoke semantic analysis diagnostic for this case, but instead, we get a parser error.

ERROR(final_not_on_accessors,none,
"only the %select{property|subscript}0 itself can be marked as 'final'"
,(bool))

Reproduction

class C {
  var prop: Int {
    final get {}
  }
}

Expected behavior

Code should survive to semantic analysis.

Environment

Swift version 6.0-dev (LLVM c7c87ee42989d4b, Swift 8493312)

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    accessorsFeature → declarations: Variable (property) accessorsbugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfmodifiersFeature: Declaration and type modifiersparserArea → compiler: The legacy C++ parserswift 6.0unexpected errorBug: Unexpected error

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions