Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Issue 12527 - Cannot make @system function/delegate alias in a @s… #5867

Merged
merged 1 commit into from
Jun 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/mtype.d
Original file line number Diff line number Diff line change
Expand Up @@ -6074,12 +6074,15 @@ extern (C++) final class TypeFunction : TypeNext
if (sc.stc & STCreturn)
tf.isreturn = true;

if (sc.stc & STCsafe)
tf.trust = TRUSTsafe;
if (sc.stc & STCsystem)
tf.trust = TRUSTsystem;
if (sc.stc & STCtrusted)
tf.trust = TRUSTtrusted;
if (tf.trust == TRUSTdefault)
{
if (sc.stc & STCsafe)
tf.trust = TRUSTsafe;
else if (sc.stc & STCsystem)
tf.trust = TRUSTsystem;
else if (sc.stc & STCtrusted)
tf.trust = TRUSTtrusted;
}

if (sc.stc & STCproperty)
tf.isproperty = true;
Expand Down
10 changes: 10 additions & 0 deletions test/compilable/test12527.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// https://issues.dlang.org/show_bug.cgi?id=12527

@system:
alias Fun = void function() @safe;
pragma (msg, Fun.stringof);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pragma msg looks like it was needed only for debugging.

static assert(Fun.stringof == "void function() @safe");
alias Del = void delegate() @safe;
pragma (msg, Del.stringof);
static assert(Del.stringof == "void delegate() @safe");