Open
Description
We have type literals for numbers already and a strictNullCheck
compiler option -- wouldn't it be awesome if we had a type guard again divide-by-zero errors? I'm building a game that involved a lot of math, computing intersections of lines and such. But what if a line is parallel? It would be cool if the compiler would suggest this as a type error.
function f(): number | 0 {
return 0
}
const y = 100 / f()
TypeScript Version: 2.7.0-dev.201xxxxx