http://d.puremagic.com/issues/show_bug.cgi?id=4027
Don <clugd...@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code CC| |clugd...@yahoo.com.au Summary|Nested function's bug in |Closures in CTFE generate |CTFE |wrong code --- Comment #1 from Don <clugd...@yahoo.com.au> 2010-03-30 11:42:35 PDT --- The workaround does NOT work. It only looks as though it does. See this, for example: === string delegate() bug4027(string s1) { string s = s1; return { return s; }; } int food() { auto a = bug4027("aaa"); auto b = bug4027("bbb"); assert(a() == "aaa"); // fails -- a() is "bbb" !!! return 1; } static assert(food()==1); ---- The root cause is that closures are not yet supported in CTFE. They should generate an error message at compile time. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------