https://d.puremagic.com/issues/show_bug.cgi?id=12527
Summary: Cannot make @system function/delegate alias in a @safe section Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: rejects-valid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bugzi...@kyllingen.net --- Comment #0 from Lars T. Kyllingstad <bugzi...@kyllingen.net> 2014-04-06 07:25:09 PDT --- 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) -- Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------