33 lines
1.2 KiB
Plaintext
33 lines
1.2 KiB
Plaintext
==== tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName2.ts (8 errors) ====
|
|
class C {
|
|
static get x() { return 1; }
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
static get x() { return 1; } // error
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
}
|
|
|
|
class D {
|
|
static set x(v) { }
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
static set x(v) { } // error
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
}
|
|
|
|
class E {
|
|
static get x() {
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
return 1;
|
|
}
|
|
static set x(v) { }
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
} |