I guess it's because you're accessing a member of _1 from inside a scope of _2 where nothing has been constructed yet? Someone more familiar with D would probably have a better answer on this part. I'm quite new :)

But a work around would be

class _2 {
          _1 instance;
        
          auto twelve() @property {
              return instance.i;
          }
        
          this() {
                  instance = new _1(12);
          }
  }


Reply via email to