TypeScript/tests/baselines/reference/interfaceWithMultipleBaseTypes2.errors.txt
2014-07-12 17:30:19 -07:00

32 lines
943 B
Plaintext

==== 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
~~~~~~~~
!!! 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'.
x: { a: number; b: string }
}
interface Derived3 extends Base, Base2 {
x: { a: string; b: string }
}