http://d.puremagic.com/issues/show_bug.cgi?id=8990

           Summary: Forward reference error on three structs
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: cbkbbej...@mailinator.com
            Blocks: 340


--- Comment #0 from Nick Sabalausky <cbkbbej...@mailinator.com> 2012-11-09 
22:05:34 PST ---
>From digitalmars.D.learn:
http://forum.dlang.org/thread/mzssmbjertutrdgmr...@forum.dlang.org

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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to