https://issues.dlang.org/show_bug.cgi?id=10619

--- Comment #3 from [email protected] ---
A clearly legal case that's currently broken:
----
import std.stdio;
void myFunc(alias Sym)()
{
        writeln(Sym);
}
void main()
{
        foreach (i; 0..3) {
                myFunc!i();
        }
        foreach (i; 5..8) {
                myFunc!i();
        }
}
----

Expected output:
----
0
1
2
5
6
7
----

Actual output:
----
0
1
2
2
2
2
----

The two instances of 'i' are clearly in distinct scopes, yet they are conflated
in the mangling of myFunc, leading to wrong generated code.

--

Reply via email to