@@ -274,6 +274,15 @@ for (i,j) in zip((:<, :isless), (:_lt, :_isless))
274274 @eval @inline ($ j)(x:: AbstractQuantity{T,D,U} , y:: AbstractQuantity{T,D,U} ) where {T,D,U} = ($ i)(x. val,y. val)
275275 @eval @inline ($ j)(x:: AbstractQuantity{T,D,U1} , y:: AbstractQuantity{T,D,U2} ) where {T,D,U1,U2} = ($ i)(promote (x,y)... )
276276 @eval @inline ($ j)(x:: AbstractQuantity{T,D1,U1} , y:: AbstractQuantity{T,D2,U2} ) where {T,D1,D2,U1,U2} = throw (DimensionError (x,y))
277+
278+ @eval @inline ($ j)(x:: DimensionlessQuantity{T,FreeUnits{(),NoDims,nothing}} , y:: ScalarQuantity{T,D,U} ) where {T,D,U} =
279+ iszero (x) && ! (y isa AffineQuantity) ?
280+ ($ i)(x. val,y. val) :
281+ throw (DimensionError (x,y))
282+ @eval @inline ($ j)(x:: ScalarQuantity{T,D,U} , y:: DimensionlessQuantity{T,FreeUnits{(),NoDims,nothing}} ) where {T,D,U} =
283+ iszero (y) && ! (x isa AffineQuantity) ?
284+ ($ i)(x. val,y. val) :
285+ throw (DimensionError (x,y))
277286end
278287
279288Base. rtoldefault (:: Type{<:AbstractQuantity{T,D,U}} ) where {T,D,U} = Base. rtoldefault (T)
0 commit comments