proposal: spec: support type inference on generic structs #61731
Labels
generics
Issue is related to generics
Proposal
TypeInference
Issue is related to generic type inference
Milestone
(I couldn't find an existing issue for this, but if there is, feel free to close!)
Problem
There's some inconsistencies in the capabilities of type inference for generics.
With functions, type inference works beautifully:
Structs also work, but they require you to explicitly pass in the generic types:
It feels rather unfortunate that you need to explicitly set the
[*Input, Output]
when usage and even syntax is otherwise so similar.Proposal
Support type inference on structs, allowing the following:
When the concrete types in
indexJson
andindexHtml
don't line up, it's a type error.Thanks for your consideration!
The text was updated successfully, but these errors were encountered: