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

63 lines
2.1 KiB
Text
Raw Normal View History

tests/cases/compiler/multipleInheritance.ts(9,19): error TS1005: '{' expected.
tests/cases/compiler/multipleInheritance.ts(9,24): error TS1005: ';' expected.
tests/cases/compiler/multipleInheritance.ts(18,19): error TS1005: '{' expected.
tests/cases/compiler/multipleInheritance.ts(18,24): error TS1005: ';' expected.
tests/cases/compiler/multipleInheritance.ts(34,7): error TS2416: Class 'Baad' incorrectly extends base class 'Good':
Types of property 'g' are incompatible:
Type '(n: number) => number' is not assignable to type '() => number'.
tests/cases/compiler/multipleInheritance.ts(35,12): error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function.
2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/multipleInheritance.ts (6 errors) ====
class B1 {
public x;
}
class B2 {
public x;
}
class C extends B1, B2 { // duplicate member
~
!!! error TS1005: '{' expected.
2014-07-13 01:04:16 +02:00
~
!!! error TS1005: ';' expected.
2014-07-13 01:04:16 +02:00
}
class D1 extends B1 {
}
class D2 extends B2 {
}
class E extends D1, D2 { // nope, duplicate member
~
!!! error TS1005: '{' expected.
2014-07-13 01:04:16 +02:00
~
!!! error TS1005: ';' expected.
2014-07-13 01:04:16 +02:00
}
class N {
public y:number;
}
class ND extends N { // any is assignable to number
public y;
}
class Good {
public f:() => number = function() { return 0; }
public g() { return 0; }
}
class Baad extends Good {
~~~~
!!! error TS2416: Class 'Baad' incorrectly extends base class 'Good':
!!! error TS2416: Types of property 'g' are incompatible:
!!! error TS2416: Type '(n: number) => number' is not assignable to type '() => number'.
2014-07-13 01:04:16 +02:00
public f(): number { return 0; }
~
!!! error TS2425: Class 'Good' defines instance member property 'f', but extended class 'Baad' defines it as instance member function.
2014-07-13 01:04:16 +02:00
public g(n:number) { return 0; }
}