On Saturday, 4 January 2014 at 08:10:18 UTC, Walter Bright wrote:
On 1/3/2014 11:42 PM, ilya-stromberg wrote:
So, in a few cases null pointers are a safety issue.
I believe this is a misunderstanding of what safety is. It
means memory safety - i.e. no memory corruption. It does not
mean "no bugs".
OK, but this feature can be also useful. For example:
class Foo
{
int i;
}
void main(string[] args)
{
Foo f;
//Oops!
writeln(f.i);
}
It's definetly bug, but compiler hasn't got any mistakes. I know
that I'll have seg fault at runtime, but see an error at compile
time will be much better. Have you got any plans to impove this
situation?