diff --git a/tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflictsEs5.ts b/tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflictsEs5.ts new file mode 100644 index 00000000000..0f260673d9d --- /dev/null +++ b/tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflictsEs5.ts @@ -0,0 +1,26 @@ +// @target: es5 + +// static name +class A { + static name: number; // error + name: string; // ok +} + +class B { + static name() {} // error + name() {} // ok +} + + + +// static length... +class C { + static length: number; // error + length: string; // ok +} + +class D { + static length() {} // error + length() {} // ok +} + diff --git a/tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflictsEs6.ts b/tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflictsEs6.ts new file mode 100644 index 00000000000..47c7dbbde25 --- /dev/null +++ b/tests/cases/conformance/classes/propertyMemberDeclarations/staticPropertyNameConflictsEs6.ts @@ -0,0 +1,25 @@ +// @target: es6 + + +// static name +class A { + static name: string; // ok + name: string; // ok +} + +class B { + static name() {}; // ok + name() {}; // ok +} + + +// static length +class C { + static length: number; // ok + length: string; // ok +} + +class D { + static length() {} // ok + length() {} // ok +}