On 2014-01-18 01:22:49 +0000, Walter Bright <[email protected]> said:

First off, in all these scenarios you describe, how does not having a null make it EASIER to track down the bug?

Implemented well, it makes it a compilation error. It works like this:

- can't pass a likely-null value to a function that wants a not-null argument.
- can't assign a likely-null value to a not-null variable.
- can't dereference a likely-null value.

You have to check for null first, and the check changes the value from likely-null to not-null in the branch taken when the pointer is valid.

--
Michel Fortin
[email protected]
http://michelf.ca

Reply via email to