Skip to content

Analyzer/Frontend inconsistency - type arguments after named constructor #34403

Description

@natebosch
class Foo<T> {
  Foo.named();
}

void main() {
  Foo.named<String>(); // No error in analyzer or CFE
  new Foo.named<String>(); // Error in analyzer only
}

Dart 1 VM did not accept the second form.

It would be breaking to make the first form an error since it has no error in either place. The inconsistency between including or not including new is jarring.

Metadata

Metadata

Assignees

Labels

front-end-missing-errorlegacy-area-front-endLegacy: Use area-dart-model instead.type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions