[Issue 9541] CTFE: wrong code with delegates, recursion
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 20 16:03:33 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9541
--- Comment #1 from Nils <nilsbossung at googlemail.com> 2013-02-20 16:03:31 PST ---
Yup, they both boil down to this:
---
cat > test.d <<code
enum e = (){
into(null, 42);
return true;
}();
void into(void delegate() sink, int set) {
if(set == 42) into(() {assert(set != 13);}, 13);
else sink();
}
code
dmd -c test.d
---
test.d(6): Error: assert(set != 13) failed
---
(output truncated)
Apparently, the delegate sees the wrong variables.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list