Bug 4321 – Passing local parameter to non-global template fails.

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-06-15T06:50:00Z
Last change time
2011-11-27T12:35:53Z
Assigned to
bugzilla
Creator
yanikibo
Depends on
3052

Comments

Comment #0 by yanikibo — 2010-06-15T06:50:17Z
class C { void f(int i)() { } void g() { foreach (i; Range!(1,10)) f!(i)(); } } Error: template instance cannot use local 'i' as parameter to non-global template f(uint i) I think it should work.
Comment #1 by yanikibo — 2010-11-27T10:37:15Z
The code below works: class C { void f(int i)() { } void g() { foreach (i; Range!(1,10)) h!(i)(this); } } void h(int i)(C c) { c.f!(i)(); } Probably that is only a compiler limitation and can be fixed (or removed) without much effort.
Comment #2 by hoganmeier — 2011-11-27T12:35:53Z
Works now.