Bug 8267 – called template only instantiated once with foreach over expression type tuple

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-06-19T09:11:00Z
Last change time
2013-11-26T09:01:10Z
Assigned to
nobody
Creator
travis

Comments

Comment #0 by travis — 2012-06-19T09:11:14Z
Take the following code: template Seq(T...) { alias T Seq; } auto exec(alias F)() { return F(); } void main() { foreach (x; Seq!(0, 1)) static assert (exec!(() => x)() == x); } This will fail with "Error: static assert (0 == 1) is false" on DMD64 v2.059.
Comment #1 by yebblies — 2013-11-26T09:01:10Z
Works now.