2014-10-28 08:28:59 +01:00
|
|
|
tests/cases/conformance/interfaces/interfaceDeclarations/interfaceWithMultipleBaseTypes2.ts(17,11): error TS2430: 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.
|
2014-09-12 22:35:07 +02:00
|
|
|
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-10-28 08:28:59 +01:00
|
|
|
!!! error TS2430: Interface 'Derived2' incorrectly extends interface 'Base'.
|
|
|
|
!!! error TS2430: Types of property 'x' are incompatible.
|
|
|
|
!!! error TS2430: Type '{ a: number; b: string; }' is not assignable to type '{ a?: string; b: string; }'.
|
|
|
|
!!! error TS2430: Types of property 'a' are incompatible.
|
|
|
|
!!! error TS2430: 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 }
|
|
|
|
}
|
|
|
|
|
|
|
|
|