diff --git a/tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts b/tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts new file mode 100644 index 0000000000000..e0564ba73ec54 --- /dev/null +++ b/tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts @@ -0,0 +1,23 @@ +class C { + x: number; + "constructor"() { + this.x = 0; + } +} +(new C).constructor(); // Error + +class D { + x: number; + 'constructor'() { + this.x = 0; + } +} +(new C).constructor(); // Error + +class E { + x: number; + ['constructor']() { + this.x = 0; + } +} +(new E).constructor();