Thread overview
[Issue 468] New: argument wrongfully identified as type in template instantiation
Oct 28, 2006
d-bugmail
Nov 23, 2006
Thomas Kuehne
Nov 25, 2006
d-bugmail
October 28, 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@digitalmars.com
        ReportedBy: roel.mathys@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.


-- 

November 23, 2006
d-bugmail@puremagic.com schrieb am 2006-10-28:
> http://d.puremagic.com/issues/show_bug.cgi?id=468

> 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.

test cases:
http://dstress.kuehne.cn/run/t/template_23_A.d
http://dstress.kuehne.cn/run/t/template_23_B.d

Thomas


November 25, 2006
http://d.puremagic.com/issues/show_bug.cgi?id=468


bugzilla@digitalmars.com changed:

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




------- Comment #2 from bugzilla@digitalmars.com  2006-11-25 03:56 -------
Fixed DMD 0.175


--