www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2533] New: compiler falls with "assertion failed" message on wrong code

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2533

           Summary: compiler falls with "assertion failed" message on wrong
                    code
           Product: D
           Version: 2.022
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: resume755 mail.ru


When compiling this code with option -unittest compiler crashes with report:

dmd: mtype.c:5564: virtual Expression* TypeStruct::dotExp(Scope*, Expression*,
Identifier*): Assertion `d' failed.

code:

template c()
{
    alias typeof( this ) M;

    M a( int op ) {
        return this;
    }

    M b ( int op ) {
        M res = this;
        res.a( op );
        return res;
    }
}

struct S
{
    mixin c;
    mixin c;
}
unittest
{
    alias S e;
}


-- 
Dec 21 2008
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2533


smjg iname.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com
           Keywords|                            |ice-on-invalid-code




------- Comment #1 from smjg iname.com  2009-01-11 17:03 -------
Doesn't crash for me, but produces (Windows):

----- 1.039 -----
bz2533.d(11): Error: bz2533.S.c!().a at bz2533.d(5) conflicts with
bz2533.S.c!().a at bz2533.d(5)
bz2533.d(11): Error: bz2533.S.c!().a at bz2533.d(5) conflicts with
bz2533.S.c!().a at bz2533.d(5)
----- 2.023 -----
bz2533.d(11): Error: overload set for res.a not allowed in struct declaration
bz2533.d(11): Error: function expected before (), not 0 of type int
bz2533.d(11): Error: overload set for res.a not allowed in struct declaration
bz2533.d(11): Error: function expected before (), not 0 of type int
----------

Can you still reproduce on Linux?


-- 
Jan 11 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2533


resume755 mail.ru changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #2 from resume755 mail.ru  2009-01-11 18:33 -------
(In reply to comment #1)
 Doesn't crash for me, but produces (Windows):
 
 ----- 1.039 -----
 bz2533.d(11): Error: bz2533.S.c!().a at bz2533.d(5) conflicts with
 bz2533.S.c!().a at bz2533.d(5)
 bz2533.d(11): Error: bz2533.S.c!().a at bz2533.d(5) conflicts with
 bz2533.S.c!().a at bz2533.d(5)
 ----- 2.023 -----
 bz2533.d(11): Error: overload set for res.a not allowed in struct declaration
 bz2533.d(11): Error: function expected before (), not 0 of type int
 bz2533.d(11): Error: overload set for res.a not allowed in struct declaration
 bz2533.d(11): Error: function expected before (), not 0 of type int
 ----------
 
 Can you still reproduce on Linux?
 

Bug is fixed in dmd 2.023 http://www.digitalmars.com/d/2.0/changelog.html#new2_023 --
Jan 11 2009