logoalt Hacker News

hgoeltoday at 1:08 AM1 replyview on HN

Presumably an analyzer that makes it an error to not have an immediately traceable zero check.

C# can do something similar with null references. It can require you to indicate which arguments and variables are capable of being null, and then compiler error/warning if you pass it to something that expects a non-null reference without a null check.


Replies

hyperhellotoday at 1:16 AM

But that’s because null is a static type. Zero isn’t a static type. How can I know if a calculation produces zero if I can’t predict the result of it at compile time?

show 2 replies