In 1. I got confused by the [keyof Type] at the end of the expression; how does it work?
In 2. I got confused by having the same type variable U used twice in different spots returning different values.
There is some form of relationship-forming happening where I can‘t follow because I don‘t know how the compiler works out a solution. Could you expand a bit on this and maybe show step by step how the compiler arrives at a solution? Now that I think of this I believe that understanding this is fundamental to getting how the whole type system works 🤔
Thanks for the writeup! There are two spots where I got stuck and I think they are related.
1.
2.
In 1. I got confused by the
[keyof Type]
at the end of the expression; how does it work?In 2. I got confused by having the same type variable
U
used twice in different spots returning different values.There is some form of relationship-forming happening where I can‘t follow because I don‘t know how the compiler works out a solution. Could you expand a bit on this and maybe show step by step how the compiler arrives at a solution? Now that I think of this I believe that understanding this is fundamental to getting how the whole type system works 🤔
Thanks for the feedback!
Will try to update the post with further explanations.