Double check why variable types not resolved on composed paths with number pieces
Closed this issue · 3 comments
birdofpreyru commented
I.e. with
type StateT = {
key: { [id: string]: 'X' },
};
the value type at the path key[${x}]
evaluates correctly to X
, but with id
typed as number
it does not.
birdofpreyru commented
It will be mostly solved by the Lodash patch DefinitelyTyped/DefinitelyTyped#69696
That path still does not cover the following corner case:
type ArrT = string[];
type T1 = GetFieldType<ArrT, `[${number}]`>; // Resolves to "undefined" rather than "string"
type T2 = GetFieldType<ArrT, number>; // This works, thought, correctly resolving to "string"
birdofpreyru commented
Updated PR should cover all cases
birdofpreyru commented
It is effectively the same as #89, thus ready.