Skip to content

Support MemberExpression and specific MethodCallExpression #4268

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

Merged
merged 1 commit into from
Dec 16, 2019
Merged

Conversation

russcam
Copy link
Contributor

@russcam russcam commented Dec 13, 2019

This commit adds support for MemberExpression and specific MethodCallExpression
as Expressions that can be passed to Field and PropertyName, in order to resolve
a string value from the expression.

The specific MethodCallExpression support is to allow F# quotations enclosing
Lambda expressions to be supported, when converted using

Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.QuotationToExpression

Fixes #4240

This commit adds support for MemberExpression and specific MethodCallExpression
as Expressions that can be passed to Field and PropertyName, in order to resolve
a string value from the expression.

The specific MethodCallExpression support is to allow F# quotations enclosing
Lambda expressions to be supported, when converted using

Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.QuotationToExpression

Fixes #4240
Copy link
Contributor

@codebrain codebrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

type = memberExpression.Member.DeclaringType;
break;
case MethodCallExpression methodCallExpression:
// special case F# method call expressions on FuncConvert
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

@russcam russcam merged commit 9949008 into 7.x Dec 16, 2019
@russcam
Copy link
Contributor Author

russcam commented Dec 16, 2019

ported to master

russcam added a commit that referenced this pull request Dec 16, 2019
This commit adds support for MemberExpression and specific MethodCallExpression
as Expressions that can be passed to Field and PropertyName, in order to resolve
a string value from the expression.

The specific MethodCallExpression support is to allow F# quotations enclosing
Lambda expressions to be supported, when converted using

Microsoft.FSharp.Linq.RuntimeHelpers.LeafExpressionConverter.QuotationToExpression

Fixes #4240

(cherry picked from commit 9949008)
@@ -56,6 +56,7 @@ public Field(PropertyInfo property, double? boost = null, string format = null)
/// </remarks>
public string Format { get; set; }

// TODO: Rename to CacheableExpression in 8.0.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not introduce it now, put an obsolete attribute on this and have the getter and setter populate the new property?

@Mpdreamz Mpdreamz deleted the fix/4240 branch February 10, 2020 10:35
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.

4 participants