TypeScript/tests/baselines/reference/indexerAssignability.errors.txt

28 lines
1.3 KiB
Plaintext
Raw Normal View History

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; }'.
Index signature is missing in type '{}'.
tests/cases/compiler/indexerAssignability.ts(8,1): error TS2322: Type '{}' is not assignable to type '{ [n: number]: string; }'.
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;
~
!!! 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;
~
!!! 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;
~
!!! 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;