From 72f30a830825b6c4d9d5428e4eeb8eb8745680ae Mon Sep 17 00:00:00 2001 From: Andrew Branch Date: Thu, 25 Apr 2019 11:35:10 -0700 Subject: [PATCH] Add test for quoted constructors --- .../quotedConstructors.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/cases/conformance/classes/constructorDeclarations/quotedConstructors.ts 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();