Generic type parameters inheritance in closures #18882
Unanswered
makrostuff
asked this question in
Questions and Answers
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am not sure if this is a bug or rather a feature request?
I would like a generic function with type parameter T to return another generic function based on the same type parameter T. It looks like closures do not inherit type parameters from their parents and I am not aware of an explicit way to specify they should do so.
This makes the higher order function fail due to incompatiple types.
Example:
Error:
So, my question is, is there already a way to do this I am not aware of?
If not, should I file this as a bug or feature request?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions