Skip to content

Revise getter/setter syntax #3602

Closed
Closed
@gbracha

Description

@gbracha

Getter declarations no longer require/allow parentheses: int get foo=> 42;

Setter declarations have an = sign after the identifier: set foo=(int x);

The name of a setter for purposes of reflection and noSuchMethod is id=, whereas the getter is just id. This allows a standard, reliable way to distinguish them by their names just like any other method.

All this needs to get into the spec.

Metadata

Metadata

Assignees

Labels

area-languageDart language related items (some items might be better tracked at github.com/dart-lang/language).

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions