❔ Generics with different input and output type
I'm writing a generic at the moment which it something like this:
When I'm calling it, is there any way to only specify
T
without specifying U
(as this can be inferred from the argument being passed in).
Ideally I'd like to be able to type something like:
rather than
Is something like this possible at all?6 Replies
no
ok
ask #roslyn if you really wanna know why
I get that it isn't something you can do in other languages - I was just wondering if it were different here 🙂
You can do it in other languages using associated types. Maybe we'll get them someday
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.