[Issue 8609] New: A forward reference error with static arrays

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 2 12:15:32 PDT 2012


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

           Summary: A forward reference error with static arrays
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-09-02 12:16:00 PDT ---
This compiles with no errors:


struct Tuple(T) {
    T arg;
}
struct Foo {
    Bar b;
}
struct Bar {
    int x;
    Tuple!(Foo) spam() {
        return Tuple!(Foo)();
    }
}
void main() {}




While this gives a forward reference error:

struct Tuple(T) {
    T arg;
}
struct Foo {
    Bar b;
}
struct Bar {
    int x;
    Tuple!(Foo[1]) spam() {
        return Tuple!(Foo[1])();
    }
}
void main() {}


DMD 2.061alpha:

test.d(4): Error: struct test.Foo no size yet for forward reference
test.d(4): Error: struct test.Foo no size yet for forward reference
test.d(9): Error: template instance test.Tuple!(Foo[1u]) error instantiating

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


More information about the Digitalmars-d-bugs mailing list