Remove superfluous .StripConversion
helper method
#631
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.
This is a continuation of #629.
There's a helper method
ExpressionExtensions.StripConversion(this LambdaExpression)
that doesn't appear to have any effect whatsoever. It can be turned into an identity function and none of the unit tests break.A closer inspection reveals the following:
The comment it contains about the
LambdaExpression
ctor introducing a cast no longer appears to hold true today. Also, the reference toProtectedMockExtensions
is rather vague. It looks a lot like things have changed so much since this code was added that it just no longer makes any sense.The method is used only in diagnostic scenarios (i.e. when an exception is about to be thrown). It is strange that automatically added conversions would only have to be removed when we're about to error already, but not in normal operation. So if it's not needed during normal operation, it is very probably that we can remove it for diagnostics, too.