-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueSpecIssues related to the TypeScript language specificationIssues related to the TypeScript language specification
Milestone
Description
interface Foo { a }
interface Bar { b }
interface Object {
[n: number]: Foo;
}
interface Function {
[n: number]: Bar;
}
var o = {};
var f = () => { };
var v1: {
//!!! Cannot convert '{}' to '{ [x: number]: Foo; }':
//!!! Numeric index signature is missing in type '{}'.
[n: number]: Foo
} = o;
var v2: {
//!!! Cannot convert '() => void' to '{ [x: number]: Bar; }':
//!!! Numeric index signature is missing in type '() => void'.
[n: number]: Bar
} = f; Expected: no errors
Actual: errors in the comments above
Verify test case:
tests/cases/compiler/augmentedTypeBracketAccessIndexSignature.ts
tests/cases/conformance/types/members/objectTypeWithCallSignatureHidingMembersOfExtendedFunction.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Breaking ChangeWould introduce errors in existing codeWould introduce errors in existing codeBugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issueSpecIssues related to the TypeScript language specificationIssues related to the TypeScript language specification