2014-12-06 01:58:49 +01:00
tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [n: number]: Foo; }'.
2014-09-12 22:35:07 +02:00
Index signature is missing in type '{}'.
2014-12-06 01:58:49 +01:00
tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [n: number]: Bar; }'.
2014-09-12 22:35:07 +02:00
Index signature is missing in type '() => void'.
2014-09-06 03:42:05 +02:00
==== tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts (2 errors) ====
2014-07-13 01:04:16 +02:00
interface Foo { a }
interface Bar { b }
interface Object {
[n: number]: Foo;
}
interface Function {
[n: number]: Bar;
}
var o = {};
var f = () => { };
var v1: {
2014-07-19 02:30:06 +02:00
~~
2014-12-06 01:58:49 +01:00
!!! error TS2322: Type '{}' is not assignable to type '{ [n: number]: Foo; }'.
2014-11-05 21:26:03 +01:00
!!! error TS2322: Index signature is missing in type '{}'.
2014-07-19 02:30:06 +02:00
[n: number]: Foo
} = o; // Should be allowed
2014-07-13 01:04:16 +02:00
var v2: {
2014-07-19 02:30:06 +02:00
~~
2014-12-06 01:58:49 +01:00
!!! error TS2322: Type '() => void' is not assignable to type '{ [n: number]: Bar; }'.
2014-11-05 21:26:03 +01:00
!!! error TS2322: Index signature is missing in type '() => void'.
2014-07-19 02:30:06 +02:00
[n: number]: Bar
} = f; // Should be allowed