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 18647 - Use of delete should be allowed without a deprecation in a deprecated scope #8066

Merged
merged 2 commits into from
Mar 25, 2018

Conversation

wilzbach
Copy link
Member

Targetting stable as this is rather relevant to the delete deprecation that was part of 2.079

// 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.");
}
Copy link
Contributor

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:
    }
}

Copy link
Member Author

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)?

@wilzbach wilzbach changed the title Fix Issue 17906 - Use of delete should be allowed without a deprecation in a deprecated scope Fix Issue 18647 - Use of delete should be allowed without a deprecation in a deprecated scope Mar 22, 2018
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
18647 enhancement Use of delete should be allowed without a deprecation in a deprecated scope

1 similar comment
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Auto-close Bugzilla Severity Description
18647 enhancement Use of delete should be allowed without a deprecation in a deprecated scope

@WalterBright
Copy link
Member

@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
Copy link
Member

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.

Copy link
Member

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
@WalterBright WalterBright merged commit b9a190b into dlang:stable Mar 25, 2018
@wilzbach wilzbach deleted the fix-17906 branch July 1, 2018 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants