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 typeof #106

Closed cesaryuan closed 3 years ago

cesaryuan commented 3 years ago

This will throw an error, but it should not.

 new EvalContext().Execute("typeof(string).Assembly");

Error

Oops! A null expression has been found. A not null statement was expected.. The error occurred for expression "." at position 14 near ".Assembly".
JonathanMagnan commented 3 years ago

Thank you for reporting @cesaryuan ,

We can successfully reproduce the error. There is a special logic we apply for type, we will try to remember why we did this logic which causes this error when trying to get a property for the type.

Best Regards,

Jon

JonathanMagnan commented 3 years ago

Hello @cesaryuan ,

The v4.0.47 has been released.

Could you try it and let us know if everything is working?

Best Regards,

Jon

cesaryuan commented 3 years ago

Hello @cesaryuan ,

The v4.0.47 has been released.

Could you try it and let us know if everything is working?

Best Regards,

Jon

I works, thank u!

cesaryuan commented 3 years ago

It seems that the problem still exists. I try the following expression, and it throws error.

typeof(string).GetMethods();
JonathanMagnan commented 3 years ago

Thank you for reporting @cesaryuan ,

My developer will look at it. Probably the same issue as the original one but this time on methods.

JonathanMagnan commented 3 years ago

Hello @cesaryuan ,

The v4.0.51 has been released.

Could you test it and let us know if we fixed it successfully?

cesaryuan commented 3 years ago

Thank you so much! It has worked!