Open
Description
Given that Scalar <: SArray
, the behavior of
Line 10 in 552bc75
is inconsistent with
StaticArrays.jl/src/convert.jl
Line 5 in 552bc75
Fortunately, in a few cases there's a very welcome ambiguity error:
julia> sa = Scalar((1,))
Scalar{Int64}((1,))
julia> Scalar(sa)
ERROR: MethodError: Scalar{T} where T(::Scalar{T}) is ambiguous. Candidates:
(::Type{Scalar{T} where T})(a::AbstractArray{T,0} where T) in StaticArrays at /home/tim/.julia/dev/StaticArrays/src/Scalar.jl:11
(::Type{Scalar{T} where T})(a::AbstractArray) in StaticArrays at /home/tim/.julia/dev/StaticArrays/src/Scalar.jl:10
(::Type{SA})(a::StaticArray) where SA<:StaticArray in StaticArrays at /home/tim/.julia/dev/StaticArrays/src/convert.jl:4
Possible fix, define
Scalar{T} where T(::StaticArray{S,T,0} where T where S<:Tuple)
Stacktrace:
[1] top-level scope at none:0
but mostly this just silently does things differently for 0 dimensions than for any other dimension.
I don't think you can really have both. Can you choose which behavior you want to keep?