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

Iain Buclaw <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |[email protected]

--- Comment #2 from Iain Buclaw <[email protected]> ---
---
mixin template genInts3() {
    static foreach (t; 0..1) {
        mixin("int i = 5;");
    }
}

unittest{
    mixin genInts3!();
    assert(i == 5);
}
---

This is a correct reduced test case of the original issue.

The (sanitized) generated code looks like:

---
unittest
{
  int t = 0;
  assert(i == 5);
}
---

The variable `i` is never declared!

--

Reply via email to