Skip to content

Rule: Return value units changed

Canonical rule slug: return-value-units-changed. ← back to all rules

A function returns the same type through the same declaration, but the unit or scale of the value changes, so consumers that interpret it per the old contract compute wrong results.

Canonical demonstration