[Issue 468] New: argument wrongfully identified as type in template instantiation

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Oct 28 03:46:17 PDT 2006


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

           Summary: argument wrongfully identified as type in template
                    instantiation
           Product: D
           Version: 0.172
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: roel.mathys at gmail.com


compile this:

template check( char ch1 
                          , char ch2)
{
        const bool check = ch1 == ch2;
}        

import std.stdio;
void main() 
{ 
        const char[] s = "123+456" ;
        writefln( check!( '+', s[3] ));
}

adding parentheses around s, e.g. (s)[3] let's the thing compile.


-- 




More information about the Digitalmars-d-bugs mailing list