This was we don't get noisy baselines just because a different phase of the compiler reported the diagnostic. This helps with Yui's refactoring work to move grammar checks into the type checker.
58 lines
No EOL
2.1 KiB
Text
58 lines
No EOL
2.1 KiB
Text
tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(2,9): error TS2300: Duplicate identifier 'x'.
|
|
tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(3,9): error TS2300: Duplicate identifier 'x'.
|
|
tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(7,9): error TS2300: Duplicate identifier 'x'.
|
|
tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(8,9): error TS2300: Duplicate identifier 'x'.
|
|
tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(19,9): error TS2300: Duplicate identifier 'x'.
|
|
tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(24,9): error TS1118: An object literal cannot have multiple get/set accessors with the same name.
|
|
tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts(24,9): error TS2300: Duplicate identifier 'x'.
|
|
|
|
|
|
==== tests/cases/conformance/classes/propertyMemberDeclarations/twoAccessorsWithSameName.ts (7 errors) ====
|
|
class C {
|
|
get x() { return 1; }
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
get x() { return 1; } // error
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
}
|
|
|
|
class D {
|
|
set x(v) { }
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
set x(v) { } // error
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
}
|
|
|
|
class E {
|
|
get x() {
|
|
return 1;
|
|
}
|
|
set x(v) { }
|
|
}
|
|
|
|
var x = {
|
|
get x() {
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
return 1;
|
|
},
|
|
|
|
// error
|
|
get x() {
|
|
~
|
|
!!! error TS1118: An object literal cannot have multiple get/set accessors with the same name.
|
|
~
|
|
!!! error TS2300: Duplicate identifier 'x'.
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
var y = {
|
|
get x() {
|
|
return 1;
|
|
},
|
|
set x(v) { }
|
|
} |