www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1408] New: Assertion failure: 'd' on line 4234 in file 'mtype.c' on faulty d code

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

           Summary: Assertion failure: 'd' on line 4234 in file 'mtype.c' on
                    faulty d code
           Product: D
           Version: 1.020
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: sky quit-clan.de


The compiler crashes when i try to compile the following faulty d code:
-------
struct ABC()
{
    alias NonExistentTemplate!() y;
}

void main()
{
    auto abc = new ABC!();
    foreach (x; abc.y) {} // Required for the compiler to crash
}
-------

The output of the compiler is:
-------
ass4234.d(3): template instance identifier 'NonExistentTemplate' is not defined
ass4234.d(8): template instance ass4234.ABC!() error instantiating
Assertion failure: 'd' on line 4234 in file 'mtype.c'

abnormal program termination
-------

It does, however, not crash if you don't use a template in the template ABC or
if you comment out the foreach loop. This bug is uncritical for development
because the compiler actually shows all the errors before crashing...


-- 
Aug 09 2007
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1408





------- Comment #1 from ddparnell bigpond.com  2007-10-19 02:20 -------
The following code also crashes with the same "Assertion failure" message.
----
struct X
{
  import std.stdio;
}
void main()
{
   X.std.stdio.writefln("");
}
----

However the following code compiles and runs ...
----
struct X
{
  import std.stdio;
}
void main()
{
   X.writefln("");
}
----


-- 
Oct 19 2007
prev sibling next sibling parent BCS <ao pathlink.com> writes:
Can we close this one? 

It looks like a dupe of #1783 and that was closed by 1.026
Mar 13 2008
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1408


gide nwawudu.com changed:

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




------- Comment #3 from gide nwawudu.com  2008-12-03 12:54 -------
(In reply to comment #1)
 The following code also crashes with the same "Assertion failure" message.
 ----
 struct X
 {
   import std.stdio;
 }
 void main()
 {
    X.std.stdio.writefln("");
 }

The error message now gives is slightly different to this title. Closing this bug and re-opened as BUG 2489. --
Dec 03 2008