safety: null checks

Dibyendu Majumdar mobile at
Sun Nov 22 11:52:13 UTC 2020

import core.stdc.stdio : printf;

extern (C++) abstract class A {
     void sayHello();

extern (C++) class B : A {
     override void sayHello() {

extern (C) void main() {
     //scope b = new B;
     B b;

Above fails because b is null. But why doesn't the compiler say 
so? It seems like a very basic safety check.

More information about the Digitalmars-d mailing list