julia> 1.0s isa Quantity{Float64, π , Unitful.FreeUnits{(Unitful.Unit{:Second, π}(0, 1//1),), π , nothing}}
true
The culprit here is are overloads of show in Unitful
function show(io::IO, x::Unit{N,D}) where {N,D}
show(io, FreeUnits{(x,), D, nothing}())
end
in conjunction with
function show(io::IO, x::Unitlike)
showoperators = get(io, :showoperators, false)
first = ""
sep = showoperators ? "*" : " "
foreach(sortexp(typeof(x).parameters[1])) do y
print(io,first)
showrep(io,y)
first = sep
end
nothing
end
which will make Unitful.Unit{:Second, π}(0, 1//1) print as s.
Question is, why are you comparing types this way? Iβd imagine itβd be more robust to check unit and dimension. But then again, isnβt a major point of working with units needing not to care about units?