For that, you have static if contitions, and indeed you can make it a compile-time error.
Can you show me this as code? And are there any plans to realize non-null references or strategies to avoid such things? Otherwise there would really be something important missing in D.
