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
}