[Issue 12531] New: forward reference with nested struct

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 6 14:42:09 PDT 2014


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 at puremagic.com
        ReportedBy: code at dawg.eu


--- Comment #0 from Martin Nowak <code at dawg.eu> 2014-04-06 14:42:07 PDT ---
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: -------


More information about the Digitalmars-d-bugs mailing list