2014-12-06 01:58:49 +01:00
|
|
|
tests/cases/compiler/indexerAssignability.ts(5,1): error TS2322: Type '{ [n: number]: string; }' is not assignable to type '{ [s: string]: string; }'.
|
|
|
|
Index signature is missing in type '{ [n: number]: string; }'.
|
|
|
|
tests/cases/compiler/indexerAssignability.ts(6,1): error TS2322: Type '{}' is not assignable to type '{ [s: string]: string; }'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Index signature is missing in type '{}'.
|
2014-12-06 01:58:49 +01:00
|
|
|
tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is not assignable to type '{ [n: number]: string; }'.
|
2014-09-12 22:35:07 +02:00
|
|
|
Index signature is missing in type '{}'.
|
|
|
|
|
|
|
|
|
2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/indexerAssignability.ts (3 errors) ====
|
|
|
|
var a: { [s: string]: string; };
|
|
|
|
var b: { [n: number]: string; };
|
|
|
|
var c: {};
|
|
|
|
|
|
|
|
a = b;
|
|
|
|
~
|
2014-12-06 01:58:49 +01:00
|
|
|
!!! error TS2322: Type '{ [n: number]: string; }' is not assignable to type '{ [s: string]: string; }'.
|
|
|
|
!!! error TS2322: Index signature is missing in type '{ [n: number]: string; }'.
|
2014-07-13 01:04:16 +02:00
|
|
|
a = c;
|
|
|
|
~
|
2014-12-06 01:58:49 +01:00
|
|
|
!!! error TS2322: Type '{}' is not assignable to type '{ [s: string]: string; }'.
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Index signature is missing in type '{}'.
|
2014-07-13 01:04:16 +02:00
|
|
|
b = a;
|
|
|
|
b = c;
|
|
|
|
~
|
2014-12-06 01:58:49 +01:00
|
|
|
!!! error TS2322: Type '{}' is not assignable to type '{ [n: number]: string; }'.
|
2014-11-05 21:26:03 +01:00
|
|
|
!!! error TS2322: Index signature is missing in type '{}'.
|
2014-07-13 01:04:16 +02:00
|
|
|
c = a;
|
|
|
|
c = b;
|