Comment #0 by andrej.mitrovich — 2011-12-22T03:33:12Z
struct Foo
{
this(void* a) { }
void opAssign(void* a) { }
}
void test(Foo foo = null) { } // ng
void main()
{
Foo foo = null; // ok
}
Comment #1 by k.hara.pg — 2011-12-22T03:44:43Z
This is a dup of 7019.
I'm not sure the implicit constructor call is allowed in default argument.
Workaround:
struct Foo
{
this(int n) { }
//void opAssign(void* a) { } // not related to this issue.
}
//void test(Foo foo = null) { } // ng
void test(Foo foo = Foo(null)) { } // ok
void main()
{
Foo foo = null; // ok
}
Comment #2 by andrej.mitrovich — 2012-12-23T06:17:08Z
*** This issue has been marked as a duplicate of issue 7019 ***