[Issue 2458] New: Can't deduce sizeof inner struct inside a template mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 16 05:51:34 PST 2008


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

           Summary: Can't deduce sizeof inner struct inside a template mixin
           Product: D
           Version: 2.020
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: 2korden at gmail.com


The following code triggers an error:

template Foo()
{
    uint getSize()
    {
        return (*this).sizeof; // line 5
    }
}

void main()
{
    struct A1
    {
        mixin Foo!(); // line 13
    }
}

test.d(5): struct test.main.A1 no size yet for forward reference
test.d(13): mixin test.main.A1.Foo!() error instantiating


-- 



More information about the Digitalmars-d-bugs mailing list