-
Notifications
You must be signed in to change notification settings - Fork 4.6k
.Net: fix: Fix AOT Compatibility - Remove Expression.Compile() from Brave/Tavily TextSearch #13541
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
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -496,7 +496,10 @@ private static void ExtractMethodCallClause(MethodCallExpression methodCall, Lis | |||||
| System.Reflection.PropertyInfo property => property.GetValue(constantExpr.Value), | ||||||
| _ => null | ||||||
| }, | ||||||
| _ => Expression.Lambda(expression).Compile().DynamicInvoke() | ||||||
| _ => throw new NotSupportedException( | ||||||
| $"Unable to extract value from expression of type '{expression.GetType().Name}'. " + | ||||||
|
||||||
| $"Unable to extract value from expression of type '{expression.GetType().Name}'. " + | |
| $"Unable to extract value from expression of type '{expression.NodeType}'. " + |
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.
For consistency with other exceptions in this file (which report
expression.NodeType), consider usingexpression.NodeTypehere instead ofexpression.GetType().Name. It tends to be a clearer indicator of what expression shape was rejected and matches the rest of the expression-analysis error messages.