4 Replies
I struggle to understand what this does. Doesn't this defeat the whole point of static typing?
Unfortunately C#'s type system is nowhere near as sophisticated as TypeScript's, so sadly this is not possible
It's not possible to describe a type through other types like this.
It facilitates reuse of types rather than duplication.
e.g.
StringItems
can be reused as many times as necessary, VS having to write Example<string>["items"]
(or a much more complex type 💀) every time.
More info @
https://www.typescriptlang.org/docs/handbook/2/indexed-access-types.html
Gotcha, thanks for the info!Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.