[Issue 2449] New: Attempting to use struct type .init inside a template causes "forward declaration" error

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 11 15:23:04 PST 2008


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

           Summary: Attempting to use struct type .init inside a template
                    causes "forward declaration" error
           Product: D
           Version: 1.036
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: jarrett.billingsley at gmail.com


Oh, forward references.  Why must you hate me so?

struct S
{ // line 16

}

template Tuple(T...)
{
        alias T Tuple;
}

template T(U)
{
        alias Tuple!(U.init) T; // line 27
}

alias T!(S) V;

Error: 

dtest.d(16): declaration _D5dtest1S6__initZ forward declaration
dtest.d(27): template instance dtest.Tuple!(_D5dtest1S6__initZ) error
instantiating


-- 



More information about the Digitalmars-d-bugs mailing list