Open MasonProtter opened 4 years ago
More evidence perhaps pointing towards the idea that the output should be 2:
julia> A = Array{Int, 0}(undef)
0-dimensional Array{Int64,0}:
0
julia> A[] = 1
1
julia> A .+ 1
2
The simplest way to get this behaviour for Scalar
is to do
Base.BroadcastStyle(::Type{<:Scalar}) = Base.Broadcast.DefaultArrayStyle{0}()
but perhaps someone who understands broadcast internals better than me could just tweak StaticArrayStyle{0}
to do the 'right' thing.
just tweak
StaticArrayStyle{0}
to do the 'right' thing
Sounds like the best approach to me.
I started rewriting StaticArrays broadcast for #744... just got bogged down and haven't had a chance to finish it, it's very fiddly! I suppose this could be considered at the same time.
If was brought up here: https://github.com/JuliaLang/julia/pull/35591 that one nice property of
Ref
is thatwhereas
I'm not sure how I feel about this difference yet, but I figured I should open an issue to discuss it.