Comment #0 by paolo.invernizzi — 2013-10-29T01:32:13Z
This is compiled correctly without the '-profile' switch, it will fails otherwise (DMD 2.063.2, 2.064.beta.4):
module b;
class B {
this() {}
}
module a;
import b;
class C : B {}
class D(X) : X {}
alias D!(C) Z;
dmd -profile a.d
Error: 'a.C.this' is not no throw
Comment #1 by yebblies — 2013-11-14T07:27:43Z
class B {
this() {}
}
class D() : B {}
void main() nothrow
{
auto d = new D!()();
}
The check for throwing is run _before_ adding the implicit super call, so D.__ctor is inferred as nothrow. With -profile, the blockExit is run again to determine if a try-finally is necessary, and it errors on the super call.
https://github.com/D-Programming-Language/dmd/pull/2765
Comment #2 by github-bugzilla — 2013-11-16T03:27:25Z