I'm a bit surprised by the following behavior, is there a rationale for returning an integer instead of a unitful quantity?
julia> using Unitful
julia> x = [1u"m"]
1-element Vector{Quantity{Int64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}:
1 m
julia> x[1] = one(eltype(x))
ERROR: DimensionError: m and 1 are not dimensionally compatible.
Stacktrace:
[1] convert(::Type{Quantity{Int64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}, x::Int64)
@ Unitful ~/.julia/packages/Unitful/GMTL8/src/conversion.jl:133
[2] setindex!(A::Vector{Quantity{Int64, 𝐋, Unitful.FreeUnits{(m,), 𝐋, nothing}}}, x::Int64, i::Int64)
@ Base ./array.jl:987
[3] top-level scope
@ ~/Documents/GitHub/Julia/_Scratchpad/mwe.jl:36
julia> x[1] == one(eltype(x))
false
julia> one(eltype(x))
1
I'm a bit surprised by the following behavior, is there a rationale for returning an integer instead of a unitful quantity?