Skip to content

fix Issue 16195 - delete should be @system#5887

Merged
andralex merged 1 commit intodlang:masterfrom
WalterBright:fix16195
Jul 1, 2016
Merged

fix Issue 16195 - delete should be @system#5887
andralex merged 1 commit intodlang:masterfrom
WalterBright:fix16195

Conversation

@WalterBright
Copy link
Member

No description provided.

@dlang-bot
Copy link
Contributor

Fix Bugzilla Description
16195 delete should be @System

---
fail_compilation/test16195.d(13): Error: delete p is unsafe
fail_compilation/test16195.d(13): Error: delete p is impure
fail_compilation/test16195.d(13): Error: delete p is non-@nogc
Copy link
Contributor

Choose a reason for hiding this comment

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

Having a different error message here is quite confusing.

I suggest something along the lines of:

fail_compilation/test16195.d(13): Error: pure function 'test' cannot use impure 'delete' operator
fail_compilation/test16195.d(13): Error: safe function 'test' cannot use system 'delete' operator
fail_compilation/test16195.d(13): Error: @nogc function 'test' cannot use non-@nogc 'delete' operator

@WalterBright
Copy link
Member Author

Blocked by dlang/phobos#4494

---
fail_compilation/test16195.d(13): Error: delete p is not @safe but is used in @safe function test
fail_compilation/test16195.d(13): Error: delete p is not @nogc but is used in @nogc function test
fail_compilation/test16195.d(13): Error: delete p is non-@nogc
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like the test for pure disappeared ?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup. For the same reason that new is not a purity violation.

@WalterBright WalterBright force-pushed the fix16195 branch 10 times, most recently from 6212201 to 57008d7 Compare June 29, 2016 23:40
src/expression.d Outdated
}

// unsafe
if (!sc.intypeof && sc.func)
Copy link
Member

Choose a reason for hiding this comment

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

if (!sc.intypeof && sc.func && sc.func.setUnsafe())
{
    error(......);
    err = true;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@andralex
Copy link
Member

lgtm % nits

@andralex
Copy link
Member

Auto-merge toggled on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants