Summary: Erroneous behaviour of variables in a delegate literal
                    passed as template tuple parameter
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Lars T. Kyllingstad <> 2010-06-21 
11:40:00 PDT ---
In the code below, the variable i is never increased above x+1.  It seems the
declaration inside the loop somehow overwrites i.  (Note that the writeln() is
only for demonstration purposes and has nothing to do with the bug.)

import std.stdio;

void run(fun...)()

void main()
    run!(delegate void()
        for (int i = 0; i < 100_000; i++)
            auto x = 0;  // i never exceeds 1

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to