[Issue 565] New: Cannot forward reference types within template parameter list

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 18 10:52:15 PST 2006


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

           Summary: Cannot forward reference types within template parameter
                    list
           Product: D
           Version: 0.174
          Platform: PC
               URL: http://www.digitalmars.com/d/template.html
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid, spec
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: deewiant at gmail.com
OtherBugsDependingO 511
             nThis:


In the spec, under "Argument Deduction", the following example is given:

template TBar(D : E*, E) { }
alias TBar!(int*, int) Bar3;    // (1) E is int
                                // (3) D is int*

This does, however, not compile:

asdf.d(1): Error: identifier 'E' is not defined
asdf.d(1): Error: E is used as a type

Another similar example is used later in the same section:

class A { }
class B : A { }

template TBar(T : U*, U : A) { }
alias TBar!(B*, B) Foo5;        // (2) T is B*
                                // (3) U is B

I'd say this is a DMD bug since it's evidently expected to work.


-- 




More information about the Digitalmars-d-bugs mailing list