Comment #0 by matti.niemenmaa+dbugzilla — 2007-10-30T16:13:23Z
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.
Comment #1 by matti.niemenmaa+dbugzilla — 2007-10-30T17:11:20Z
(In reply to comment #0)
> asdf.d(2): function asdf.Foo._ctor expected to return a value of type int
Oops! Disregard that, the code as posted doesn't result in that error message, only the ICE.
Comment #2 by matti.niemenmaa+dbugzilla — 2008-09-03T01:18:12Z
Changed in DMD 1.035 such that _ctor is reserved. A quick look doesn't give me anything in the docs about it but I'll leave this as a FIXED ice-on-invalid-code.