Skip to content

Invoking a setter for a field that only has a getter defined #2408

Closed
@DartBot

Description

@DartBot

This issue was originally filed by [email protected]


dartc fails co19 test
Language/10_Expressions/15_Getter_Invocation_A07_t07.dart

class C {
  static get setter() {}
}

main() {
  try {
    C.setter = 1;
  } catch(var e) {}
}

The invocation of C.setter is not valid because there is no setter. For assignment of C.v 10.16 says it is a compile-time error if C does not declare implicitly or explicitly a setter v.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions