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

8 lines
329 B
Plaintext
Raw Normal View History

2014-07-13 01:04:16 +02:00
==== tests/cases/compiler/numericIndexerConstraint2.ts (1 errors) ====
class Foo { foo() { } }
var x: { [index: string]: Foo; };
var a: { one: number; };
x = a;
~
!!! Type '{ one: number; }' is not assignable to type '{ [x: string]: Foo; }':
!!! Index signature is missing in type '{ one: number; }'.