-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript
Description
type MapThing<T> = {
[x: string]: T; // Property 'length' of type 'number' is not assignable to string index type 'T'.
length: number;
}
let a: MapThing<number>;
let b: MapThing<string>;
interface MapThingi<T> {
[x: string]: T; // Property 'length' of type 'number' is not assignable to string index type 'T'.
length: number;
}
let c: MapThingi<number>;
let d: MapThingi<string>;
A type parameter on an indexer is checked eagerly, should happen on instantiation.
Metadata
Metadata
Assignees
Labels
Needs ProposalThis issue needs a plan that clarifies the finer details of how it could be implemented.This issue needs a plan that clarifies the finer details of how it could be implemented.SuggestionAn idea for TypeScriptAn idea for TypeScript