Comment #0 by bus_dbugzilla — 2012-11-09T22:05:34Z
From digitalmars.D.learn: http://forum.dlang.org/thread/[email protected]
struct A(T)
{
T t;
}
struct B(T)
{
A!(T)* a;
}
struct C
{
B!(C)* b;
}
Result:
test.d(2): Error: struct test.A!(C).A has forward references
test.d(11): Error: template instance test.B!(C) error instantiating
Workaround:
Inside the definition of "struct B(T)", move "A!(T)" to an optional template parameter:
struct B(T, U=A!(T))
{
U* a;
}
This *might* be related to #6969, but I'm not sure.
(In reply to comment #1)
> >
> > This *might* be related to #6969, but I'm not sure.
>
> Also appears to be related, if not identical, to this one
> http://d.puremagic.com/issues/show_bug.cgi?id=3834
Scratch that, #3834 is not related to this one at all.
Comment #5 by bus_dbugzilla — 2012-11-13T08:31:51Z
@Don: FWIW, The reason I wasn't sure if this was the same was because if you take the #6969 test case and replace all the "class" with "struct", it works. But, of course, Hara's pull apparently fixes both, so all the better :)
Comment #6 by github-bugzilla — 2012-11-13T12:27:42Z