Summary: alias this, immutable and common type fail in presence
                    of fields with indirections
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-11-10 08:24:28 PST ---
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.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to