Skip to content

Remove deprecated enforceEx#7283

Closed
MoonlightSentinel wants to merge 1 commit intodlang:masterfrom
MoonlightSentinel:remove-enforceex
Closed

Remove deprecated enforceEx#7283
MoonlightSentinel wants to merge 1 commit intodlang:masterfrom
MoonlightSentinel:remove-enforceex

Conversation

@MoonlightSentinel
Copy link
Contributor

@MoonlightSentinel MoonlightSentinel commented Nov 16, 2019

Extracted from #7280 and blocked by:

@n8sh
Copy link
Member

n8sh commented Nov 16, 2019

This is a fine example of why deprecations of this kind are bad.

Change Log: 2.080.0

std.exception.enforceEx was deprecated in favor of std.exception.enforce
With 2.079 std.exception.enforce became a complete super set of std.exception.enforceEx

enforce behaves exactly the same as enforceEx given the same arguments. The name std.exception.enforceEx isn't misleading and there are no plans to reuse it to mean something else. The best approach would have been to write

/// Legacy alias for `enforce`.
alias enforceEx = enforce

and never speak of it again.

@MoonlightSentinel
Copy link
Contributor Author

I wouldn't mind keeping a legacy alias but it was already scheduled for removal and would probably need some formal approval (akin to adding a new symbol).

One might argue that introducing this could introduce hidden behaivour changes in highly templated code because enforce is a superset of enforceEx (allthough this is propably a very hypothetical case)

@MoonlightSentinel
Copy link
Contributor Author

Closing in favour of #7545

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.

2 participants