TypeScript/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt
2014-07-12 17:30:19 -07:00

25 lines
783 B
Plaintext

==== tests/cases/compiler/inheritanceMemberFuncOverridingAccessor.ts (4 errors) ====
class a {
get x() {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
return "20";
}
set x(aValue: string) {
~
!!! Accessors are only available when targeting ECMAScript 5 and higher.
}
}
class b extends a {
~
!!! Class 'b' incorrectly extends base class 'a':
!!! Types of property 'x' are incompatible:
!!! Type '() => string' is not assignable to type 'string'.
x() {
~
!!! Class 'a' defines instance member accessor 'x', but extended class 'b' defines it as instance member function.
return "20";
}
}