Skip to main content

New site for Dart news and articles

For the latest Dart news, visit our new blog at  https://medium.com/dartlang .

Breaking Change: Disabling Support for Old Getter Syntax

Matthias Hausner writes:

On Wed Nov 28, we will disable support for the old getter definition syntax. The empty formal parameter list in the getter definition will be a compile error.

To convert your sources from old to new syntax, simply remove the empty parameter list after the getter name, for example:

old:  int get Length() => a.length;
new:  int get Length => a.length;
As always, we invite you to join our Dart mailing list, ask questions on Stack Overflow, or file feature requests on dartbug.com.