Closed
Description
TypeScript Version: 2.9
Code
export interface Dict<T> {
[key: string]: T;
}
type a = Dict<boolean>;
type b = keyof a;
Expected behavior:
b
should be string
Actual behavior:
b
is string | number
Maybe there is a simple fix to this but I cannot find anything. My temporary fix is to use "keyofStringsOnly": true
.
Playground Link:
Related Issues:
#24560 may be the same but I cannot tell.
Metadata
Metadata
Assignees
Labels
No labels