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

12 lines
573 B
Plaintext
Raw Normal View History

tests/cases/compiler/numericIndexerConstraint2.ts(4,1): error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: Foo; }'.
Index signature is missing in type '{ one: number; }'.
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;
~
!!! error TS2322: Type '{ one: number; }' is not assignable to type '{ [index: string]: Foo; }'.
2014-11-05 21:26:03 +01:00
!!! error TS2322: Index signature is missing in type '{ one: number; }'.