[Issue 468] New: argument wrongfully identified as type in template instantiation
Thomas Kuehne
thomas-dloop at kuehne.cn
Thu Nov 23 02:54:27 PST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
d-bugmail at 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
-----BEGIN PGP SIGNATURE-----
iD8DBQFFZX19LK5blCcjpWoRAjjMAJ0eLZjZYEGZa/KFCImK70RmA1WR6wCeMlEh
TIeHVVWktdIAVzt0fcYHMFM=
=0Mmg
-----END PGP SIGNATURE-----
More information about the Digitalmars-d-bugs
mailing list