DMD 2.058/DMD 2.059head
---
Bar New(T,A...)(A args){return null;}
class Bar{
this(Foo){ }
static Bar create(){
return New!Bar(Foo(0));
}
}
struct Foo{
int x;
this(T)(T ){void function() foo = {Bar.create();};}
void bar(){Foo r=Foo("");}
}
---
---
Internal error: e2ir.c 688
---
Comment #1 by timon.gehr — 2012-04-06T15:08:30Z
The -inline switch is necessary to trigger the bug.
Comment #2 by timon.gehr — 2012-04-06T15:09:26Z
The following variation crashes the compiler with a segmentation fault:
Bar New(T)(Foo args){return null;}
class Bar{
this(Foo){ }
static Bar create(){
return New!Bar(Foo(0));
}
}
struct Foo{
int x;
this(T)(T ){void function() foo = {Bar.create();};}
void bar(){Foo r=Foo("");}
}
Comment #3 by timon.gehr — 2012-04-06T15:16:41Z
The following variation causes an ICE in a different location:
---
Bar New(T,A...)(A args){return null;}
class Bar{
this(Foo){ }
static Bar create(){
return New!Bar(Foo(0)).foo();
}
Bar foo(){return this;}
}
struct Foo{
int x;
this(T)(T ){void function() foo = {Bar.create();};}
void bar(){Foo r=Foo("");}
}
---
---
Internal error: e2ir.c 3500
---
Comment #4 by robert — 2012-05-02T08:31:03Z
Please report another bug for the ICE in a different location. See also bug #7851.
Comment #5 by bugzilla — 2013-10-06T22:20:39Z
All the examples compile successfully with 2.064 head.