julia> using SIUnits, SIUnits.ShortUnits, Base.Test
julia> @inferred 1m
ERROR: return type SIUnits.SIQuantity{Int64,1,0,0,0,0,0,0,0,0} does not match inferred return type Union{Int64,SIUnits.SIQuantity{T<:Number,m,kg,s,A,K,mol,cd,rad,sr}}
in error(::String) at ./error.jl:21
in error(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
julia> x = 1m
1 m
julia> @inferred x*x
ERROR: return type SIUnits.SIQuantity{Int64,2,0,0,0,0,0,0,0,0} does not match inferred return type Union{Int64,SIUnits.SIQuantity{T<:Number,m,kg,s,A,K,mol,cd,rad,sr}}
in error(::String) at ./error.jl:21
in error(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
It seems like there is enough information available to determine these exponents at compile time.
Currently, it seems like most of the operations are type-unstable:
It seems like there is enough information available to determine these exponents at compile time.