Eval-Expression.NET icon indicating copy to clipboard operation
Eval-Expression.NET copied to clipboard

Error when as Func<string>

Open cesaryuan opened this issue 4 years ago • 3 comments

Execute the code below with EvalManager.DefaultContext.Execute

object handler = "";
if(handler is string)
{
	// anything
	int a = 1;
} 
else if (handler is Func<string>)
{
	(handler as Func<string>)();
}

It will throw Exception like this

Oops! A general error has occurred.Contact our support team for more information or if you believe it's an error on our part: [email protected]

Version: 4.0.71

cesaryuan avatar Jan 28 '22 08:01 cesaryuan

Hello @cesaryuan ,

Thank you for reporting, we will look at it.

Best Regards,

Jon

JonathanMagnan avatar Jan 28 '22 13:01 JonathanMagnan

Hi, Any updates here?

cesaryuan avatar Feb 24 '22 04:02 cesaryuan

Hello @cesaryuan ,

Unfortunately supporting it correctly is harder than we initially thought.

The first prototype fix that has been proposed by my employee was refused. This week, we made some progress to better parse this kind of syntax, but we have not completed it yet.

The good thing is that we continue to work on it, so we hope to be able to provide you a fix soon but we do not have any determined date yet.

JonathanMagnan avatar Feb 24 '22 16:02 JonathanMagnan