class C { void fun() { throw new Exception("oops"); } } class D : C { override void fun() nothrow { } } void main() { D d = new D; C c = new D; d.fun(); // ok c.fun(); // ok }