digitalmars.D.bugs - [Issue 4359] New: Erroneous behaviour of variables in a delegate literal passed as template tuple parameter
- d-bugmail puremagic.com (37/37) Jun 21 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4359
- d-bugmail puremagic.com (12/12) Jul 16 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4359
- d-bugmail puremagic.com (7/7) Jul 16 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4359
http://d.puremagic.com/issues/show_bug.cgi?id=4359
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
AssignedTo: nobody puremagic.com
ReportedBy: bugzilla kyllingen.net
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...)()
{
fun[0]();
}
void main()
{
run!(delegate void()
{
for (int i = 0; i < 100_000; i++)
{
writeln(i);
auto x = 0; // i never exceeds 1
}
})();
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 21 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4359
Don <clugdbug yahoo.com.au> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |clugdbug yahoo.com.au
Resolution| |DUPLICATE
*** This issue has been marked as a duplicate of issue 4246 ***
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 16 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4359 Actually bug 4246 is itself a duplicate of 1350. *** This issue has been marked as a duplicate of issue 1350 *** -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 16 2010









d-bugmail puremagic.com 