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.
33 lines
No EOL
1.6 KiB
Text
33 lines
No EOL
1.6 KiB
Text
tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(7,7): error TS2415: Class 'b' incorrectly extends base class 'a'.
|
|
Types of property 'x' are incompatible.
|
|
Type 'string' is not assignable to type '() => string'.
|
|
tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(8,9): error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor.
|
|
tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts(11,9): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
|
|
|
|
==== tests/cases/compiler/inheritanceMemberAccessorOverridingMethod.ts (4 errors) ====
|
|
class a {
|
|
x() {
|
|
return "20";
|
|
}
|
|
}
|
|
|
|
class b extends a {
|
|
~
|
|
!!! error TS2415: Class 'b' incorrectly extends base class 'a'.
|
|
!!! error TS2415: Types of property 'x' are incompatible.
|
|
!!! error TS2415: Type 'string' is not assignable to type '() => string'.
|
|
get x() {
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
~
|
|
!!! error TS2423: Class 'a' defines instance member function 'x', but extended class 'b' defines it as instance member accessor.
|
|
return "20";
|
|
}
|
|
set x(aValue: string) {
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
|
|
}
|
|
} |