Hello! I am struggling a bit with types coming from Unitful in arrays. Here is a simple MWE:
using Unitful
array_unit = [1.0, 3, 4]u"yr"
If I look at the type of array_unit, I obtain this:
typeof(array_unit)
Vector{Quantity{Float64, π, FreeUnits{(yr,), π, nothing}}} (alias for Array{Quantity{Float64, π, Unitful.FreeUnits{(yr,), π, nothing}}, 1})
So why does this not work?
array_unit::Array{Quantity{Float64, Unitful.π, Unitful.FreeUnits{(Unitful.yr,), Unitful.π, nothing}}, 1}
This throws:
ERROR: TypeError: in typeassert, expected Vector{Quantity{Float64, π, Unitful.FreeUnits{(yr,), π, nothing}}}, got a value of type Vector{Quantity{Float64, π, Unitful.FreeUnits{(yr,), π, nothing}}}
Stacktrace:
[1] top-level scope
@ REPL[13]:1
which seems to be the same thing to meβ¦
I am still a bit new to types so maybe I am missing something fondamental here.
Cheers,