TypeScript/tests/baselines/reference/inheritanceMemberFuncOverridingAccessor.errors.txt
2014-09-12 13:35:07 -07:00

33 lines
No EOL
1.6 KiB
Text

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