34 lines
No EOL
1.2 KiB
Text
34 lines
No EOL
1.2 KiB
Text
tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(15,5): error TS2322: Type '{}' is not assignable to type '{ [n: number]: Foo; }'.
|
|
Index signature is missing in type '{}'.
|
|
tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts(19,5): error TS2322: Type '() => void' is not assignable to type '{ [n: number]: Bar; }'.
|
|
Index signature is missing in type '() => void'.
|
|
|
|
|
|
==== tests/cases/conformance/types/members/augmentedTypeAssignmentCompatIndexSignature.ts (2 errors) ====
|
|
interface Foo { a }
|
|
interface Bar { b }
|
|
|
|
interface Object {
|
|
[n: number]: Foo;
|
|
}
|
|
|
|
interface Function {
|
|
[n: number]: Bar;
|
|
}
|
|
|
|
var o = {};
|
|
var f = () => { };
|
|
|
|
var v1: {
|
|
~~
|
|
!!! error TS2322: Type '{}' is not assignable to type '{ [n: number]: Foo; }'.
|
|
!!! error TS2322: Index signature is missing in type '{}'.
|
|
[n: number]: Foo
|
|
} = o; // Should be allowed
|
|
|
|
var v2: {
|
|
~~
|
|
!!! error TS2322: Type '() => void' is not assignable to type '{ [n: number]: Bar; }'.
|
|
!!! error TS2322: Index signature is missing in type '() => void'.
|
|
[n: number]: Bar
|
|
} = f; // Should be allowed |