-
Notifications
You must be signed in to change notification settings - Fork 47
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
Julia 0.6 TODO: write awesome promotion rules #273
Comments
Can they move to Lines 9 to 11 in 0ceb396
Lines 1 to 6 in 5d6f18a
|
Those seem like reasonable candidates for moving. |
I wrote awful promotion rules in ColorTypes.jl on Julia 1.3 (cf. JuliaGraphics/ColorTypes.jl#170). 😄 |
They're beautiful, not awful. Though I know exactly what you mean. So glad to have this fixed! |
Between ColorTypes and #272, we have some useful but imperfect promotion rules that I propose to fix once we can rely on the awesome new type system. Here's one simple example of current failings:
This behavior is a consequence of these rules. The ideal way to write this would be to separately promote the "inner" type (
Float32
orFloat64
) and the "outer" type (e.g.,RGB1{<:Fractional}
). I suffered through doing something similar with conversion (e.g.,convert(RGB, c)
without specifying the "inner" type) on julia 0.4, and it wasn't fun: getting the dispatch working properly for types with only a typevar inner type was basically black art and strongly dependent on the order of function definitions. I basically don't have the time/patience to do this again. But once we can rely on the new type system, this should be much more pleasant.The text was updated successfully, but these errors were encountered: