TypeScript/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt

25 lines
783 B
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== 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";
}
}