-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
triangular dispatch (left-to-right template parameter chaining) #3766
Comments
+1 |
It wouldn't cause the foundations of the type system to crumble, but it would cause them to be more difficult to implement :) True that there are lots of uses of this; I have wanted it a few times myself. In this particular case, |
That's a helpful tip re |
+typemax(Uint128) I believe this is referred to as "triangular dispatch"? See this discussion. |
Following up on #6620 here. This feature seems necessary for defining |
bump |
Closing in favor of Jeff's proposal mentioned here. Feel free to reopen if that wouldn't cover the issue here. |
If it wouldn't cause the very foundations of the type system to crumble, it seems like it would be nice to be able to do this:
Use case: given an inheritance pattern
this:
has problems because methods like this:
take precedence. One needs to use constructs like this:
Even this:
fails to take precedence. But I have more concrete image types defined than just
Image
, so it would be nice to have this work more generally without having to list all of them.There's also an example in the FAQ that might benefit from this. In that case one could solve the problem using an inner constructor, but this type-chaining would have been more natural.
The text was updated successfully, but these errors were encountered: