On Monday, 20 May 2013 at 00:55:14 UTC, Kenji Hara wrote:
Unfortunately this is currently not a bug.
T.init provides "default initialized" object image, and it
*does not*
provide "default constructed" object. The difference is
important.
That is already documented in lanugage reference.
http://dlang.org/property#init
Note: .init produces a default initialized object, not default
constructed. That means using .init is sometimes incorrect.
1. If T is a nested struct, the context pointer in T.init is
null.
2. If T is a struct which has @disable this();, T.init might
return a
logically incorrect object.
Kenji Hara
In that case, kindly let me understand why it is not possible to
allow explicit default constructor for structs given that:
1. The constructor gets called at run time.
2. Is not considered for evaluating S.init (compile time).