Consider the following:
@safe:
alias Fun = void function() @system;
pragma (msg, Fun.stringof);
alias Del = void delegate() @system;
pragma (msg, Del.stringof);
When compiling this, DMD prints:
void function() @safe
void delegate() @safe
In other words, the @safe: directive somehow prevents the @system attribute from becoming part of the alias. Here is a test case which should compile, but which doesn't:
@safe:
alias Fun = void function() @system;
@system void foo() { }
@trusted void bar(Fun fun) { fun(); }
void main() { bar(&foo); }
This fails with the following error message:
bug.d(5): Error: function bug.bar (void function() @safe fun) is not callable using argument types (void function() @system)
Comment #1 by bugzilla — 2014-04-06T11:55:52Z
Actually, I think the test case should compile even without the explicit @system attribute. I've filed a separate report about this, see issue 12529.