blob: 4a7b0df2ed1607e3d0979e255e29ac4ce7d3ab7a [file] [log] [blame]
/*
TEST_OUTPUT:
---
fail_compilation/ice10259.d(11): Error: circular reference to `ice10259.D.d`
fail_compilation/ice10259.d(11): called from here: `(*function () pure nothrow @safe => x)()`
---
*/
class D
{
int x;
D d = { auto x = new D(); return x; }();
}
enum x = new D;
/*
TEST_OUTPUT:
---
fail_compilation/ice10259.d(25): Error: circular reference to `ice10259.D2.d`
fail_compilation/ice10259.d(25): called from here: `(*function () pure nothrow @safe => x)()`
---
*/
class D2
{
int x;
D2 d = function { auto x = new D2(); return x; }();
}
enum x2 = new D2;