Skip to content

Parser accepts type arguments after the constructor name #34159

Closed
@askeksa-google

Description

@askeksa-google
class C {
  C.named();
}

main() {
  new C.named<int>();
}

Is accepted without complaints. The type arguments are seemingly ignored. It should be a compile-time error (this is invalid syntax). The test language_2/named_constructor_test exposes this.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions