-
Notifications
You must be signed in to change notification settings - Fork 152
Fix inference on axes for broadcasting #547
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
Conversation
Does this fix #540 ? |
See also JuliaLang/julia#30074. |
@@ -58,3 +58,6 @@ end | |||
Base.@pure function Base.checkindex(::Type{Bool}, ::SOneTo{n1}, ::SOneTo{n2}) where {n1, n2} | |||
return n1::Int >= n2::Int | |||
end | |||
|
|||
Base.promote_rule(a::Type{Base.OneTo{T}}, ::Type{SOneTo{n}}) where {T,n} = | |||
Base.OneTo{promote_type(T, Int)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is not strictly necessary for the fix (it's just the first thing I tried). I could get rid of this if you have reservations about it. (One also has to be rid of the tests this adds to core.jl
.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good.
@@ -58,3 +58,6 @@ end | |||
Base.@pure function Base.checkindex(::Type{Bool}, ::SOneTo{n1}, ::SOneTo{n2}) where {n1, n2} | |||
return n1::Int >= n2::Int | |||
end | |||
|
|||
Base.promote_rule(a::Type{Base.OneTo{T}}, ::Type{SOneTo{n}}) where {T,n} = | |||
Base.OneTo{promote_type(T, Int)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good.
Codecov Report
@@ Coverage Diff @@
## master #547 +/- ##
==========================================
+ Coverage 66.12% 66.18% +0.05%
==========================================
Files 38 38
Lines 2893 2898 +5
==========================================
+ Hits 1913 1918 +5
Misses 980 980
Continue to review full report at Codecov.
|
Fixes #546