zzzprojects / Eval-Expression.NET

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

Ambiguous match found for: 'TryParse' for int, bool, DateTime #90

Closed se closed 1 year ago

se commented 3 years ago

Following code samples giving almost same error. Is there any way to fix this?

Code - 1:

Z.Expressions.Eval.Execute(@"bool.TryParse(""false"", out bool value);");

Error - 1:

Unhandled exception. Z.Expressions.Compiler.Shared.EvalException: Oops! Ambiguous match found for: 'TryParse'. The error occurred for expression "." at position 4 near ".TryParse(\"false\", out bo".

Code - 2:

Z.Expressions.Eval.Execute(@"DateTime.TryParse(""2020-01-01"", out DateTime date);");

Error - 2:

Unhandled exception. Z.Expressions.Compiler.Shared.EvalException: Oops! Ambiguous match found for: 'TryParse'. The error occurred for expression "." at position 8 near ".TryParse(\"2020-01-01\", o".

Code - 3:

Z.Expressions.Eval.Execute(@"DateTime.TryParse(""2020-01-01"", out var date);");

Error - 3:

Unhandled exception. Z.Expressions.Compiler.Shared.EvalException: Oops! Ambiguous match found for: 'TryParse'. The error occurred for expression "." at position 8 near ".TryParse(\"2020-01-01\", o".
JonathanMagnan commented 3 years ago

Hello @se ,

Thank you for reporting,

It seems to look under .NET Framework but we have an issue on .NET Core.

We will look at what is missing.

Best Regards,

Jon

se commented 3 years ago

Any luck on this?

JonathanMagnan commented 3 years ago

Hello @se ,

Yes, my developer fixed it and we will complete the review tomorrow.

So if everything is fine, we will make a new release on Tuesday or Wednesday

JonathanMagnan commented 3 years ago

Hello @se ,

The v4.0.29 has been released.

Could you try it and let us know if that has been fixed correctly?

Best Regards,

Jon

se commented 3 years ago

It seems fixed. Thank you so much!

JonathanMagnan commented 3 years ago

Awesome @se !

we are glad to hear that it has been fixed!

Don't hesitate to contact us with any questions, or further assistance,

Jon