Skip to main content

New Dart Lang Spec tweaks switch statement, abstract methods, and more

Posted by Seth Ladd


We just published version 0.09 of the Dart Language Spec.

Changes include:

  • Abstract methods may specify default values.
  • Interface methods may specify default values.
  • The ~/ operator can apply to doubles.
  • Refined rules regarding abstract class instantiation, allowing factories to be used.
  • switch statement specification revised.
  • throw may not throw null.
  • Imports introduce a scope separate from the library scope. Multiple libraries may share prefix.
  • Recursive typedefs disallowed.

The switch statement now requires either all the expressions in the cases to evaluate to constant integers or they all evaluate to constant strings. Also, a warning can be generated if you omit the break statement in a case.

As always, the Dart mailing list is standing by to answer your questions, and dartbug.com is a good way to file bugs and feature requests.