1 /*
2 TEST_OUTPUT:
3 ---
4 fail_compilation/ctfe13612.d(15): Error: function ctfe13612.S.recurse CTFE recursion limit exceeded
5 fail_compilation/ctfe13612.d(20):        called from here: s.recurse()
6 fail_compilation/ctfe13612.d(15):        1000 recursive calls to function recurse
7 fail_compilation/ctfe13612.d(23):        called from here: (new S).recurse()
8 fail_compilation/ctfe13612.d(23):        while evaluating: `static assert((new S).recurse())`
9 ---
10 */
11 
12 class S
13 {
14     int x;
recurse()15     int recurse()
16     {
17         S s;
18         assert(!x); // Error: class 'this' is null and cannot be dereferenced
19         s = new S();
20         return s.recurse();
21     }
22 }
23 static assert(new S().recurse());
24