https://issues.dlang.org/show_bug.cgi?id=20786
--- Comment #3 from RazvanN <razvan.nitu1...@gmail.com> --- (In reply to Steven Schveighoffer from comment #2) > Shouldn't that work though? > > This compiles just fine: > > void x(void function() foo) { foo(); } > > void bar() @nogc pure nothrow @safe {} > > void main() > { > x(&bar); > } > > I guess a good counter case would be helpful here. Argh, you are right. I messed up the patch, sorry! It seems dmd does attribute inference for nested functions, except if the the function is the member of a nested aggregate declaration. --