[Issue 1525] New: Can't instantiate template with bogus error messages

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Sep 22 18:18:09 PDT 2007


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

           Summary: Can't instantiate template with bogus error messages
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: davidl at 126.com


template k(U:V[C])
{
        void func(U a, C v){writefln("hello");};
}
int[char]v;
char m;
k!(int[char]).func(v);
gives me:
abc.d(7): variable abc.v conflicts with variable abc.v at abc.d(5)
abc.d(1): Error: identifier 'C' is not defined
abc.d(1): Error: index is not a type or an expression
abc.d(1): Error: identifier 'V' is not defined
abc.d(1): Error: V is used as a type

modify the last line to k!(int[char]).func(v,m) gives me:
abc.d(7): found ',' when expecting ')'
abc.d(7): semicolon expected, not 'm'
abc.d(7): no identifier for declarator m
abc.d(7): semicolon expected, not ')'
abc.d(7): Declaration expected, not ')'


-- 



More information about the Digitalmars-d-bugs mailing list