All T's built-in property init should have an exact same type as T.
But, in current, enum and non-nested struct have broken this principle.
Test case. All is(typeof(U.init) == U) should print 'true'.
----
import std.traits, std.typetuple;
void main()
{
enum E { x, y }
int i;
static struct S {}
static class C {}
struct NS { void f(){ i++; } }
class NC { void f(){ i++; } }
foreach (T; TypeTuple!(E, S, C, NS, NC))
foreach (U; TypeTuple!(T, const T, immutable T, shared T, shared const T, inout T, shared inout T))
{
pragma(msg, U, ": ", typeof(U.init), " -> ", is(typeof(U.init) == U));
}
}
Comment #1 by github-bugzilla — 2012-11-18T21:01:58Z