2014-12-06 01:58:49 +01:00
tests/cases/compiler/stringIndexerAssignments1.ts(4,1): error TS2322: Type '{ one: string; }' is not assignable to type '{ [index: string]: string; one: string; }'.
2014-09-12 22:35:07 +02:00
Index signature is missing in type '{ one: string; }'.
2014-12-06 01:58:49 +01:00
tests/cases/compiler/stringIndexerAssignments1.ts(5,1): error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [index: string]: string; one: string; }'.
2014-10-28 08:28:59 +01:00
Types of property 'one' 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/compiler/stringIndexerAssignments1.ts (2 errors) ====
var x: { [index: string]: string; one: string; };
var a: { one: string; };
var b: { one: number; two: string; };
x = a;
~
2014-12-06 01:58:49 +01:00
!!! error TS2322: Type '{ one: string; }' is not assignable to type '{ [index: string]: string; one: string; }'.
2014-11-05 21:26:03 +01:00
!!! error TS2322: Index signature is missing in type '{ one: string; }'.
2014-07-13 01:04:16 +02:00
x = b; // error
~
2014-12-06 01:58:49 +01:00
!!! error TS2322: Type '{ one: number; two: string; }' is not assignable to type '{ [index: string]: string; one: string; }'.
2014-11-05 21:26:03 +01:00
!!! error TS2322: Types of property 'one' are incompatible.
!!! error TS2322: Type 'number' is not assignable to type 'string'.
2014-07-13 01:04:16 +02:00