Replies: 1 comment 1 reply
-
Can you explain further / with an example what you mean by "conversion function to a generic type." There might be a better way to accomplish what you want, but right now I only vaguely understand what kinds of problems you are looking to solve using generics, implicits, and static overloading. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Implicit parameters are a feature I've yet to be fully comfortable with, but I've realized a couple of places where there might be limitations. Particularly when it comes to conversions.
Currently, the conversion functions of the language are written as the name of the type they convert to. However, this makes it difficult to use implicit parameters to refer to "a conversion function to a generic type".
I feel like this issue could be addressed by simply naming all conversion functions the same name by convention, since the correct function can be picked via implicit parameters, but I feel like that could mess with type inference in non-generic use.
Another way to solve it could be to allow the name of the type referred to by a generic type be used in the implicit parameter name, but that means adding a whole new language feature just to deal with this, admittedly niche, issue.
What other ways could be pursued to address this?
Beta Was this translation helpful? Give feedback.
All reactions