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

Replace .ToLambda() conversions with static typing #629

Merged
merged 6 commits into from
Jun 12, 2018

Conversation

stakx
Copy link
Contributor

@stakx stakx commented Jun 12, 2018

This is the first out of several refactorings that attempt to get rid (as much as possible) of chained expression transforms such as .PartialMatcherAwareEval().ToLambda() which are found all over the codebase. They are problematic because it's not immediately clear when these transforms are needed, and which of them are needed for what reasons.

.ToLambda() is a mix-up of two separate concerns:

  1. Perform a downcast from Expression to LambdaExpression
  2. Strip a type-cast (if present) from the lambda's body

As it turns out, (1) becomes superfluous if we simply re-declare certain members as LambdaExpression instead of Expression. Incidentally, this makes visible the heretofore unstated expectation that MethodCall.SetupExpression be a lambda expression.

ToLambda is then renamed to StripConversion to better reflect its remaining function (2).

@stakx stakx merged commit 6e57b70 into devlooped:master Jun 12, 2018
@stakx stakx deleted the remove-tolambda branch June 12, 2018 11:19
@devlooped devlooped locked and limited conversation to collaborators Sep 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant