-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Closed as not planned
Labels
Not a DefectThis behavior is one of several equally-correct optionsThis behavior is one of several equally-correct options
Description
π Search Terms
keyof any string
π Version & Regression Information
Tested in the playground on "v3.3.3333" and "Nightly", it occurs in both versions
β― Playground Link
π» Code
type Obj = { [k in keyof any]: number }
// ^? type Obj = { [x: string]: number; }
type Keys = keyof Obj;
// ^? type Keys = string | number | symbol
declare const obj: Obj;
obj[Symbol.iterator] // (This breaks)
π Actual behavior
The Obj
type allows indexing only with strings
π Expected behavior
The Obj
type should allow indexing with every type of property key
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
Not a DefectThis behavior is one of several equally-correct optionsThis behavior is one of several equally-correct options