In the following code, the second delegate literal is incorrectly inferred as unsafe: static assert(is(typeof((){})==void function()pure nothrow @safe)); // ok static assert(is(typeof((){return;})==void function()pure nothrow @safe));// fail Error: static assert (is(void function() pure nothrow == void function() pure nothrow @safe)) is false
https://github.com/D-Programming-Language/dmd/pull/642 This is a shortfall of fixing bug 6902.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/24d920a8d96ccee6394a3b4f987881956c071c54 Merge pull request #642 from 9rnsr/fix7321 Issue 7321 - returning void considered unsafe by safety inference