Thread overview
[Issue 6928] New: alias this, immutable and common type fail in presence of fields with indirections
Nov 10, 2011
timon.gehr@gmx.ch
Nov 12, 2011
Kenji Hara
Nov 16, 2011
Walter Bright
November 10, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6928

           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
        AssignedTo: nobody@puremagic.com
        ReportedBy: timon.gehr@gmx.ch


--- Comment #0 from timon.gehr@gmx.ch 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: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 12, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6928


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-11-12 06:18:47 PST ---
https://github.com/D-Programming-Language/dmd/pull/466

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
November 16, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6928


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


--- Comment #2 from Walter Bright <bugzilla@digitalmars.com> 2011-11-15 21:23:26 PST ---
https://github.com/D-Programming-Language/dmd/commit/57db617ba6eec8ce67bb3f20d33022d534a5dba2

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------