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 .

Update your optional params syntax now, Dart VM and dart2js

Régis Crelier, engineer on the Dart team, posted the notice that both the Dart VM and dart2js will start to enforce the new optional parameter rules. From his mail:


On Monday, we will submit a change to bleeding-edge enforcing the new optional parameter syntax and semantics, as described in the spec.
Until now, both the vm and dart2js have been running in a backward compatible mode, where named arguments could still be passed to optional positional formal parameters, which is not allowed under the new rules. 
If you want to check before Monday whether your code is going to break, please use the flag --reject_named_argument_as_positional for both the vm and dart2js.

To learn more about these changes, read about how named optional params and positional optional params are specified differently.

As always, we encourage you to join the Dart mailing list, ask questions on Stack Overflow, and file feature requests and bugs at dartbug.com. Thanks!