TypeScript's number type is a lie

https://bluepnume.medium.com/typescripts-number-type-is-a-lie-6b3b10dd8f54

Comments

glkindlmannMay 27, 2026, 4:39 AM
Supporting operator overloading is part of the linked TS issue [1]. But I'm more curious: why did operator overloading in ES6 itself [2] die?

[1] https://github.com/microsoft/TypeScript/issues/42218

[2] https://github.com/tc39/proposal-operator-overloading

bluepnumeMay 27, 2026, 4:58 AM
Probably if nothing else, impossible to have it perform well without static typing?
newaccountman2May 27, 2026, 2:10 AM
Am I incorrect in thinking this is not a TypeScript problem, but a problem most languages have, and that TypeScript is one of the few with a neat little solution?
bluepnumeMay 27, 2026, 2:57 AM
In most languages you could probably solve this problem with a class. But wrapping all your numbers in a class with runtime consequences, just for a bit of extra type safety, feels quite extreme.