Skip to content

[dart 4.0] Remove support for new in constructor invocations #4726

Description

@munificent

We made new optional in Dart 2.0, 8 years ago. We have a lint that tells people not to use new. The lint is in the recommended set. Our core library and Flutter docs don't use new.

It has never meant anything semantic because even an expression marked new might be invoking a factory constructor which doesn't allocate an object.

How about we finally get rid of it as a keyword at constructor invocations completely?

Metadata

Metadata

Assignees

No one assigned

    Labels

    dart-4.0Features considered for the Dart 4.0 release.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions