www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1039] New: DMD hangs with 100% CPU

reply d-bugmail puremagic.com writes:

           Summary: DMD hangs with 100% CPU
           Product: D
           Version: 1.007
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: r.a3 ntlworld.com

Compiling these files with "dmd module1.d" causes DMD to hang with 100% CPU
usage; it doesn't respond to ^C and needs to be killed with the task manager.
It's annoying!

--- module1.d:
import module2;
import module3;

class FirstClass: FirstInterface
        mixin Template!(SecondClass);
class SecondClass: SecondBaseClass { }

void main() { }

--- module2.d:
import module3;

interface FirstInterface
        SecondBaseClass func(ThirdClass);

template Template( TYPE )
        TYPE func(ThirdClass)
                return new TYPE(this);

--- module3.d:
abstract class SecondBaseClass { }
class ThirdClass { }

Mar 08 2007
next sibling parent d-bugmail puremagic.com writes:

------- Comment #1 from r.a3 ntlworld.com  2007-03-08 09:55 -------
Sorry, I made a mistake. Is there no way to edit these? module3.d should be:

import module2;

abstract class SecondBaseClass
        this(FirstInterface) {}
class ThirdClass

Mar 08 2007
prev sibling parent d-bugmail puremagic.com writes:

unknown simplemachines.org changed:

           What    |Removed                     |Added
                 CC|                            |unknown simplemachines.org
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME

------- Comment #2 from unknown simplemachines.org  2009-03-29 23:54 -------
This appears to be resolved in (or earlier than) DMD 1.041 and 2.026.

It now shows this error message and exits properly:
module2.d(12): constructor module1.SecondClass.this () does not match parameter
types (FirstClass)
module2.d(12): Error: expected 0 arguments, not 1
module1.d(8): constructor module1.SecondClass.this no match for implicit
super() call in constructor

It compiles fine if I add an explicit constructor to SecondClass calling
super(), which I assume is a covariance issue.  If that is a bug it should be
filed separately.


Mar 29 2009