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

14 lines
626 B
Plaintext

==== tests/cases/compiler/stringIndexerAssignments1.ts (2 errors) ====
var x: { [index: string]: string; one: string; };
var a: { one: string; };
var b: { one: number; two: string; };
x = a;
~
!!! Type '{ one: string; }' is not assignable to type '{ [x: string]: string; one: string; }':
!!! Index signature is missing in type '{ one: string; }'.
x = b; // error
~
!!! Type '{ one: number; two: string; }' is not assignable to type '{ [x: string]: string; one: string; }':
!!! Types of property 'one' are incompatible:
!!! Type 'number' is not assignable to type 'string'.