Skip to content

Optional new and const for Dart 2 (meta issue) #30921

@lrhn

Description

@lrhn

Dart 2 will make new and const operators optional in some cases. The feature is described in https://github.com/dart-lang/sdk/blob/master/docs/language/informal/implicit-creation.md.

This feature needs support from, at least, the common front-end. The kernel compiler can, and likely will, generate the same kernel code whether an optional new or const is present or not, so back-ends should be unaffected. Effectively, the kernel (or even the parser) can perform automatic "new/const" insertion on the program, as soon as it can recognize an invocation as referring to a constructor rather than a static method.

The feature extends the grammar with syntax that wasn't previously valid, so the formatter likely needs to be prepared for it.
The analyzer may need to be prepared for the different syntax as well.

We will not back-port this feature to non-kernel based backends.

Metadata

Metadata

Assignees

Labels

area-metaCross-cutting, high-level issues (for tracking many other implementation issues, ...).

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions