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

20 lines
651 B
Plaintext

==== tests/cases/compiler/indexerAssignability.ts (3 errors) ====
var a: { [s: string]: string; };
var b: { [n: number]: string; };
var c: {};
a = b;
~
!!! Type '{ [x: number]: string; }' is not assignable to type '{ [x: string]: string; }':
!!! Index signature is missing in type '{ [x: number]: string; }'.
a = c;
~
!!! Type '{}' is not assignable to type '{ [x: string]: string; }':
!!! Index signature is missing in type '{}'.
b = a;
b = c;
~
!!! Type '{}' is not assignable to type '{ [x: number]: string; }':
!!! Index signature is missing in type '{}'.
c = a;
c = b;