[Issue 1627] New: ICE with a method called _ctor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 30 14:13:25 PDT 2007


http://d.puremagic.com/issues/show_bug.cgi?id=1627

           Summary: ICE with a method called _ctor
           Product: D
           Version: 1.022
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: matti.niemenmaa+dbugzilla at iki.fi


class Foo {
        void _ctor() {}
}

void main() {
        Foo f = new Foo();
}

asdf.d(2): function asdf.Foo._ctor expected to return a value of type int
Assertion failure: 'member' on line 3208 in file 'expression.c'

http://www.digitalmars.com/d/1.0/lex.html states that "[i]dentifiers starting
with __ (two underscores) are reserved". This code probably fails because DMD
uses the name _ctor for constructors. Either that should be __ctor or names
starting with only one underscore should also be reserved.

In any case, an ICE shouldn't result.


-- 



More information about the Digitalmars-d-bugs mailing list