-
-
Notifications
You must be signed in to change notification settings - Fork 610
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 18647 - Use of delete should be allowed without a deprecation in a deprecated scope #8066
Conversation
| // 3. Removal of keyword, "delete" can be used for other identities | ||
| if (!exp.isRAII) | ||
| deprecation(exp.loc, "The `delete` keyword has been deprecated. Use `object.destroy()` (and `core.memory.GC.free()` if applicable) instead."); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bug report was more general (before you changed the title).
I took delete as an example, because it's what hits me, but I'm pretty sure it affects other deprecations.
For example:
deprecated void main ()
{
int i, o;
switch (i)
{
case 1:
o = 1;
case 2:
o = 2;
break;
default:
}
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OKay I created a new subissue 18647 of 17906 which just addresses the delete deprecation.
Maybe deprecation should require the current scope, s.t. sc.isDeprecated can automatically be called (and we don't need to patch this in at all places)?
…on in a deprecated scope
1 similar comment
|
@wilzbach In the future, please note in bugzilla that this PR exists. I did it for this one. |
| @@ -0,0 +1,6 @@ | |||
| // REQUIRED_ARGS: -de | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the corresponding bugzilla issue as a comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added it.
add bugzilla link
Targetting stable as this is rather relevant to the
deletedeprecation that was part of 2.079