← Back to index
|
Original Bugzilla link
Bug 974 – compile-time parenthesis bug
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-02-17T05:14:00Z
Last change time
2014-02-16T15:25:40Z
Assigned to
bugzilla
Creator
Daniel919
Comments
Comment #0
by Daniel919 — 2007-02-17T05:14:44Z
import std.stdio; template eval(A...) { alias A eval; } char[] trimfirst(char[] s) { int x = 0; foreach (char each; s) { if (each != ' ') //{ return s[x .. $]; //} //Without the parenthesis, the compile-time version doesn't work ! x++; } return s; } void main() { writefln(eval!(trimfirst(" test"))); //Output: " test" writefln(trimfirst(" test")); //Output: "test" }
Comment #1
by bugzilla — 2007-02-26T19:26:12Z
Fixed DMD 1.007
Comment #2
by thomas-dloop — 2007-03-11T06:20:44Z
Added to DStress as
http://dstress.kuehne.cn/run/i/interpret_01_A.d
http://dstress.kuehne.cn/run/i/interpret_01_B.d