-
Notifications
You must be signed in to change notification settings - Fork 147
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
broadcast is ambiguous with base #132
Comments
The problem here is that Base broadcast requires zero or more arguments whereas here it requires one or more. Presumably just need to get rid of the Overall, |
This is due to a recent PR by @tkelman: https://github.com/JuliaArrays/StaticArrays.jl/pull/126/files I suspect we should role back that particular change for |
Just ran into this also. Can't say I'm following closely enough to understand why the two separate function broadcast(f, a::Union{_, Number, StaticArray}, b::Union{_, Number, StaticArray}...) where {_<:StaticArray} this will only match when there's at least one StaticArray present among the args, so there's not even a question of if its more specific. |
(See also https://discourse.julialang.org/t/incorrect-ambiguity/2690 since this trick/hack doesn't always work, granted I just checked it does in this case) |
Thanks @marius311 - that's a very interesting observation. |
Even |
How would you feel about this (less than elegant) work around for low number of arguments: @propagate_inbounds broadcast(f, a::StaticArray, b::Union{Number, StaticArray}...) = _broadcast(f, broadcast_sizes(a,b...), a, b...)
@propagate_inbounds broadcast(f, n1::Number, a::StaticArray, b::Union{Number, StaticArray}...) = _broadcast(f, broadcast_sizes(n1,a,b...), n1, a, b...)
@propagate_inbounds broadcast(f, n1::Number, n2::Number, a::StaticArray, b::Union{Number, StaticArray}...) = _broadcast(f, broadcast_sizes(n1,n2,a,b...), n1, n2, a, b...) |
Does #135 work for you @dlfivefifty? |
Yep, it does!
… On 3 Apr 2017, at 4:48 pm, Andy Ferris ***@***.***> wrote:
Does #135 <#135> work for you @dlfivefifty <https://github.com/dlfivefifty>?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#132 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/ABLDqfvXcMVnzTQ7Uf9X_FQJavnkwaw7ks5rsJYygaJpZM4MwYUB>.
|
I assume this is sorted now out via #135. By the way @marius311 that's a really nice trick. I've used in #136 which would otherwise seem intractable in general. |
This method: https://github.com/Keno/StaticArrays.jl/blob/master/src/broadcast.jl#L7
is ambiguous with base:
that's bad form
The text was updated successfully, but these errors were encountered: