constructor
can't be the name of class accessors and generators.
#48948
Labels
Bug
A bug in TypeScript
Good First Issue
Well scoped, documented and has the green light
Help Wanted
You can do this
Milestone
Bug Report
In classes, accessors (aka getters/setters) and generators can't be named with
constructor
. They're Syntax Errors defined in spec.References:
MethodDefinition
section.constructor
getter
setter
accessor
generator
Tested on 4.5.5, 4.6.2 and Nightly (4.7).
Playground link with relevant code
No errors reported.
TypeScript should report errors for misusing
constructor
as accessor name for Line 2 and Line 5, and report error for misusingconstructor
as generator for Line 9 in the example above.The text was updated successfully, but these errors were encountered: