http://d.puremagic.com/issues/show_bug.cgi?id=9739
--- Comment #2 from Kenji Hara <[email protected]> 2013-04-03 18:27:10 PDT --- (In reply to comment #1) > This is caused by: > https://github.com/D-Programming-Language/dmd/pull/1439 > > I think I've already tried to change how the 'defaultCtor' field is set, but I > think that change got rejected, or maybe it was part of a pull that wasn't yet > merged. > > In hindsight I should have written more elaborate tests. > > @Kenji: Do you know why the code which sets `ad->defaultCtor = this;` doesn't > check for defaulted parameters? That code is at the end of > `CtorDeclaration::semantic` Because ad->defaultCtor should not have any parameters. Its function pointer will be stored in TypeInfo_Class.defaultConstructor, so storing `this(int arg=0)` in it would cause access violation in runtime. https://github.com/D-Programming-Language/druntime/blob/master/src/object_.d#L853 https://github.com/D-Programming-Language/dmd/blob/master/src/toobj.c#L585 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
