-
-
Notifications
You must be signed in to change notification settings - Fork 424
Conversation
@@ -490,7 +490,7 @@ inout(V) get(K, V)(inout(V[K])* aa, K key, lazy inout(V) defaultValue) | |||
|
|||
// Scheduled for deprecation in December 2012. | |||
// Please use destroy instead of clear. | |||
alias destroy clear; | |||
deprecated alias destroy clear; |
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.
deprecated
can take an optional message, so I suggest changing this to:
deprecated("Please use destroy instead.")
Also you could change it to use new-style alias syntax:
deprecated("Please use destroy instead.")
alias clear = destroy;
LGTM so long as Phobos + druntime don't trigger the message. |
@andralex: Are we ok to move forward with this? |
It should be fine, I just enabled the autotester for this pull. |
@@ -490,7 +490,8 @@ inout(V) get(K, V)(inout(V[K])* aa, K key, lazy inout(V) defaultValue) | |||
|
|||
// Scheduled for deprecation in December 2012. |
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.
Shouldn't the comment be updated?
I think the convention is to remove 6 months after deprecation.
yah, let's |
Auto-merge toggled on |
Yeah, it looks like I missed this one, because the message on it didn't match what I normally put on symbols marked as scheduled for deprecation. And we may want to keep it around later than October, since it's listed in TDPL, but it's long past time for it to be deprecated rather than just scheduled to be deprecated. |
This pull request follows up on a change in 2.060.0 (http://dlang.org/changelog.html#new2_060)
It appears to be overdue given the following comment in the source code:
Its continued existence can cause confusion with other methods named 'clear' due to UFCS, and also causes confusion for students of D as can be witnessed here (http://forum.dlang.org/thread/ogpnmoyqbldexrmijexa@forum.dlang.org#post-ogpnmoyqbldexrmijexa:40forum.dlang.org)
Although it may be safe to eliminate it completely, this PR simply marks it as deprecated, so any existing uses of
clear
are flagged with warnings.clear
can be eliminated aftter a couple of releases with this deprecation warning in place.Accompanying documentation pull request to come shortly.