https://issues.dlang.org/show_bug.cgi?id=19569
Simen Kjaeraas <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #5 from Simen Kjaeraas <[email protected]> --- Still wrong. Consider: void foo()() { throw new Exception(""); } // Definitely not nothrow void foo()() nothrow { } // definitely is nothrow void test() { foo(); } void test() nothrow { foo(); } This gives the exact same error as before, demonstrating that this is indeed a problem exactly the way Manu describes it. However, if both variants of foo are indeed inferred to be nothrow, the criticisms presented by Jacob are correct. As for 'if the user explicitly added an attribute to a template, then inference for that attribute should be disabled at the time of instantiation.', consider this: void bar()() nothrow { throw new Exception(""); } unittest { bar(); } That gives the error message 'nothrow function bar!().bar may throw', so that already is disabled - if a templated function is marked nothrow, it has to abide by that promise. --
