← Back to index
|
Original Bugzilla link
Bug 468 – argument wrongfully identified as type in template instantiation
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2006-10-28T05:46:00Z
Last change time
2014-02-15T13:22:07Z
Assigned to
bugzilla
Creator
roel.mathys
Comments
Comment #0
by roel.mathys — 2006-10-28T05:46:17Z
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.
Comment #1
by thomas-dloop — 2006-11-23T05:03:01Z
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
[email protected]
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-----
Comment #2
by bugzilla — 2006-11-25T03:56:00Z
Fixed DMD 0.175