Because we model only non-zero dimensions, it's currently possible to assign incompatible quantities to one another due to their type covariance:
const speed: Quantity<{length: 1, seconds: -1}> = metersPerSecond(5);
const length: Quantity<{length: 1}> = speed; // ouch
While we can't protect against this for all user-defined dimensions, we should look into making at least the built-in dimensions more robust by modeling known dimensions with exponent 0. I need to think through all the possible corner-cases though.
Because we model only non-zero dimensions, it's currently possible to assign incompatible quantities to one another due to their type covariance:
While we can't protect against this for all user-defined dimensions, we should look into making at least the built-in dimensions more robust by modeling known dimensions with exponent 0. I need to think through all the possible corner-cases though.