fix Issue 16195 - delete should be @system#5887
Merged
andralex merged 1 commit intodlang:masterfrom Jul 1, 2016
Merged
Conversation
Contributor
test/fail_compilation/test16195.d
Outdated
| --- | ||
| 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 |
Contributor
There was a problem hiding this comment.
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
Member
Author
|
Blocked by dlang/phobos#4494 |
test/fail_compilation/test16195.d
Outdated
| --- | ||
| 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 |
Contributor
There was a problem hiding this comment.
Looks like the test for pure disappeared ?
Member
Author
There was a problem hiding this comment.
Yup. For the same reason that new is not a purity violation.
6212201 to
57008d7
Compare
src/expression.d
Outdated
| } | ||
|
|
||
| // unsafe | ||
| if (!sc.intypeof && sc.func) |
Member
There was a problem hiding this comment.
if (!sc.intypeof && sc.func && sc.func.setUnsafe())
{
error(......);
err = true;
}
Member
|
lgtm % nits |
Member
|
Auto-merge toggled on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.