SciNim / Unchained

A fully type safe, compile time only units library.
https://scinim.github.io/Unchained
110 stars 0 forks source link

emit short and long versions of user given types #38

Closed Vindaar closed 1 year ago

Vindaar commented 1 year ago

Works around the following:

    defUnit(ft²•ft⁻³)
    let x = 1.m⁻¹
    check x.to(ft²•ft⁻³) == 0.3048.ft⁻¹
    check x.to(ft²•ft⁻³) == 0.3048.ft²•ft⁻³

now producing problems as we emit the long form of user given types later. Those were not defined, because we only define long versions of the reduced version, i.e. Foot⁻¹.