On Friday, 19 October 2018 at 06:53:32 UTC, dangbinghoo wrote:
why the code bellow compiles?
D compilers are allowed to make that an error, but it might not. With the current implementation, dmd that.d will compile, but dmd -O that.dwill fail with an error. Yes, turning on optimizations happens to catch the null flow at compile time.
It is just a matter of compiler implementation happening to catch it or not.