A note on certain compounds like Liter, Acre (the only two compounds that have no UnitKind that is its base type).
Currently our implementation is confused by compound units that are not defined as their own actual unit. So Meter³, which is the base of Liter is not actually considered for auto conversion (only for type checking).
That means math like the following has a weird quirk:
block:
let x = 1.Liter
let y = 1.m³
doAssert type(x + y) is Liter
doAssert type(y + x) is Meter³
It wouldn't be too bad. The problem is the scale conversions are applied in both cases. So in the first case the actual number does just become 1.001. But it thinks it's liters!
A note on certain compounds like
Liter
,Acre
(the only two compounds that have noUnitKind
that is its base type).Currently our implementation is confused by compound units that are not defined as their own actual unit. So
Meter³
, which is the base ofLiter
is not actually considered for auto conversion (only for type checking).That means math like the following has a weird quirk:
It wouldn't be too bad. The problem is the scale conversions are applied in both cases. So in the first case the actual number does just become
1.001
. But it thinks it's liters!