zzzprojects / Eval-Expression.NET

C# Eval Expression | Evaluate, Compile, and Execute C# code and expression at runtime.
https://eval-expression.net/
Other
449 stars 86 forks source link

something wrong with the dynamic #87

Closed cesaryuan closed 3 years ago

cesaryuan commented 3 years ago
var context = new EvalContext();
context.Execute(@"
      dynamic jpart = new Dictionary<string, object>();
      jpart[""dw""] = 1;");

Execute above sentences in the VS. It throw the error like this. But it should work.

System.InvalidCastException:“无法将类型为“System.Linq.Expressions.NewArrayInitExpression”的对象强制转换为类型“System.Linq.Expressions.ConstantExpression”。”

System.InvalidCastException: "Cannot cast an object of type "System.Linq.Expressions.NewArrayInitExpression" to type "System.Linq.Expressions.ConstantExpression"."

JonathanMagnan commented 3 years ago

Hello @cesaryuan ,

Thank you for reporting, we will look at it.

Best Regards,

Jon

JonathanMagnan commented 3 years ago

Hello @cesaryuan ,

The v4.0.26 has been released.

Let me know if your issue has been correctly solved.

Best Regards,

Jon

cesaryuan commented 3 years ago

Let me know if your issue has been correctly solved.

Thank you! It works for me.