no size yet for forward reference error

Erik Smith via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 24 20:23:52 PST 2016


Here's a better reduction of the problem.  Commenting out either 
of the lines marked HERE eliminates the error.   It's some kind 
of interaction with templates, RefCounted, and the cross 
referencing types.

erik


module database;
import std.typecons;

unittest {
     auto con = Connection!int();
}

struct Connection(T) {
     alias Statement = .Statement!T;   // HERE
}

struct Statement(T) {
     alias Connection = .Connection!T;

     private:

     struct Payload {
         Connection con;
         this(Connection con_) {con = con_;}
     }

     alias RefCounted!(Payload, RefCountedAutoInitialize.no) Data;
     Data data_;  // HERE
}


More information about the Digitalmars-d mailing list