digitalmars.D.bugs - [Issue 13612] New: Wrong 'this' variable accessed in recursive ctfe
- via Digitalmars-d-bugs (30/30) Oct 13 2014 https://issues.dlang.org/show_bug.cgi?id=13612
https://issues.dlang.org/show_bug.cgi?id=13612 Issue ID: 13612 Summary: Wrong 'this' variable accessed in recursive ctfe member function Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: CTFE, wrong-code Severity: major Priority: P1 Component: DMD Assignee: nobody puremagic.com Reporter: yebblies gmail.com class S { int x; int recurse() { S s; assert(!x); // Error: class 'this' is null and cannot be dereferenced s = new S(); return s.recurse(); } } static assert(new S().recurse()); In the interpreter's visit(ThisExp), the first branch for localThis is not taken because localThis is a VarExp, not a StructLiteralExp. --
Oct 13 2014