www.digitalmars.com         C & C++   DMDScript  

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

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: jarrett.billingsley 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


-- 
Nov 11 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2449


jarrett.billingsley gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE





You know, I thought this bug sounded familiar..

Sad that I had forgotten I reported it.

*** This bug has been marked as a duplicate of 1667 ***


-- 
Nov 12 2008