2014-09-12 22:35:07 +02:00
|
|
|
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts(17,11): error TS2429: Interface 'Derived2' incorrectly extends interface 'Base':
|
|
|
|
Types of property 'x' are incompatible:
|
|
|
|
Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }':
|
|
|
|
Types of property 'a' are incompatible:
|
|
|
|
Type 'number' is not assignable to type 'string'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts (1 errors) ====
|
|
|
|
interface Base {
|
|
|
|
x: {
|
|
|
|
a?: string; b: string;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Base2 {
|
|
|
|
x: {
|
|
|
|
b: string; c?: number;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Derived extends Base, Base2 {
|
|
|
|
x: { b: string }
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Derived2 extends Base, Base2 { // error
|
|
|
|
~~~~~~~~
|
2014-09-12 00:19:57 +02:00
|
|
|
!!! error TS2429: Interface 'Derived2' incorrectly extends interface 'Base':
|
|
|
|
!!! error TS2429: Types of property 'x' are incompatible:
|
|
|
|
!!! error TS2429: Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }':
|
|
|
|
!!! error TS2429: Types of property 'a' are incompatible:
|
|
|
|
!!! error TS2429: Type 'number' is not assignable to type 'string'.
|
2014-07-13 01:04:16 +02:00
|
|
|
x: { a: number; b: string }
|
|
|
|
}
|
|
|
|
|
|
|
|
interface Derived3 extends Base, Base2 {
|
|
|
|
x: { a: string; b: string }
|
|
|
|
}
|
|
|
|
|
|
|
|
|