T x; struct S{ T get() const {return x;} alias get this; } struct T{int* p;} // p is necessary. immutable(S) s; immutable(T) t; static assert(is(typeof(1? s:t))); // ok. static assert(is(typeof(1? t:s))); // ok. static assert(is(typeof(1? s:t)==typeof(1? t:s))); // fail. void main(){ auto x = 1? t:s; // ok. auto y = 1? s:t; // compile error. } The code should compile fine.
https://github.com/D-Programming-Language/dmd/pull/466
https://github.com/D-Programming-Language/dmd/commit/57db617ba6eec8ce67bb3f20d33022d534a5dba2