TypeScript/tests/baselines/reference/objectLiteralIndexerErrors.errors.txt
Daniel Rosenwasser 6e77e2e810 Removed colons from diagnostic messages.
Also got rid of the 'terminalMessages' concept.
2014-10-28 00:48:58 -07:00

26 lines
No EOL
1 KiB
Text

tests/cases/compiler/objectLiteralIndexerErrors.ts(13,5): error TS2323: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'.
Index signatures are incompatible.
Type 'A' is not assignable to type 'B'.
Property 'y' is missing in type 'A'.
==== tests/cases/compiler/objectLiteralIndexerErrors.ts (1 errors) ====
interface A {
x: number;
}
interface B extends A {
y: string;
}
var a: A;
var b: B;
var c: any;
var o1: { [s: string]: A;[n: number]: B; } = { x: b, 0: a }; // both indexers are A
~~
!!! error TS2323: Type '{ [x: string]: A; [x: number]: A; 0: A; x: B; }' is not assignable to type '{ [x: string]: A; [x: number]: B; }'.
!!! error TS2323: Index signatures are incompatible.
!!! error TS2323: Type 'A' is not assignable to type 'B'.
!!! error TS2323: Property 'y' is missing in type 'A'.
o1 = { x: c, 0: a }; // string indexer is any, number indexer is A