www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12531] New: forward reference with nested struct

https://d.puremagic.com/issues/show_bug.cgi?id=12531

           Summary: forward reference with nested struct
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: code dawg.eu



cat > bug.d << CODE
struct Node(T)
{
    T _val;
}

void foo()
{
    static struct Foo
    {
        Node!(Foo)* node;
    }
}
CODE

dmd -c bug.d
----
a.d(1): Error: struct a.Node!(Foo).Node has forward references
----

Declaring struct Foo outside of a function resolves the problem.

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