digitalmars.D.bugs - [Issue 4209] New: Can not return from foreach over associative array
- d-bugmail puremagic.com (33/33) May 19 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4209
- d-bugmail puremagic.com (14/14) May 19 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4209
- d-bugmail puremagic.com (6/6) May 19 2010 http://d.puremagic.com/issues/show_bug.cgi?id=4209
http://d.puremagic.com/issues/show_bug.cgi?id=4209
Summary: Can not return from foreach over associative array
Product: D
Version: 2.041
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: wrong-code
Severity: major
Priority: P2
Component: DMD
AssignedTo: nobody puremagic.com
ReportedBy: Jesse.K.Phillips+D gmail.com
CC: Jesse.K.Phillips+D gmail.com
09:55:33 PDT ---
The code below demonstrates that even though the function can only return
'false' it will return 'true' This is with DMD 2.043
void main() {
assert(success() == false);
}
bool success() {
auto arr = ["Hello":"Misty", "There":"Cats"];
foreach(a; arr)
if(a == "Cats") {
return false;
} else if(a == "Misty") {
} else
assert(false, "Should never get here.");
return true;
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4209
Steven Schveighoffer <schveiguy yahoo.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |schveiguy yahoo.com
Resolution| |DUPLICATE
10:15:28 PDT ---
This was recently fixed in 2.046.
Building your code with 2.046 compiles and runs as expected (no assertion).
*** This issue has been marked as a duplicate of issue 4184 ***
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 19 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4209 13:59:09 PDT --- Thanks I would have never guessed they were the same issue. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
May 19 2010









d-bugmail puremagic.com 