Get<Paths<T>>
fails when T has no properties that are known at compile time
#991
Labels
bug
Something isn't working
Bug description
When
T
has no keys that are known at compile time, the Result ofPaths<T>
is not assignable to the second argument ofGet
.Repro
https://www.typescriptlang.org/play/?#code/JYWwDg9gTgLgBDAnmApnA3nA4imAaOABQEMYALAZzgF84AzKCEOAciVQFo6UKYWBYAFBDgAOxgoodYgGM0AIQCuAcwA8AFTgoAHhNEATKumoA+DELhwwjMBQBc2XBoIlyFDSZNDqQA
produces the error
Expected behaviour
I expect the code not to produce a compilation error. Specifically,
Paths<T>
should be a valid argument toGet<T, ⋅>
for allT
that are neithernull
norundefined
. (If I’m not mistaken, every other type in javascript does have properties).In instances where
T
has a concrete type, theBug::props
type should be inferred.Upvote & Fund
The text was updated successfully, but these errors were encountered: