www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6928] New: alias this, immutable and common type fail in presence of fields with indirections

reply d-bugmail puremagic.com writes:
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



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: -------
Nov 10 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6928


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

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



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: -------
Nov 12 2011
prev sibling parent d-bugmail puremagic.com writes:
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



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: -------
Nov 15 2011