Compiles without error on D1 (1.072)
Give a forward reference error with D2 (2.058)
struct Foo {
enum x = Foo();
static Foo opCall() {
return Foo.init;
}
}
testx.d(5): Error: forward reference to type Foo
testx.d(5): Error: cannot implicitly convert expression (Foo()) of type Foo to Foo
Comment #4 by hsteoh — 2014-08-06T14:55:33Z
Seems to work now (compiles and runs with -main), though it does hit a deprecation warning:
-----
test.d(2): Deprecation: variable test.Foo.x const field with initializer should be static, __gshared, or an enum
-----
Comment #5 by hsteoh — 2014-08-06T14:56:26Z
P.S. This is on git HEAD (post 2.066).
Comment #6 by github-bugzilla — 2014-08-10T12:54:36Z