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

new release regression

Open mrtristan opened this issue 1 year ago • 3 comments

Our code works on 6.1.8, updated to 6.2.0 and we're getting this: image

presumably has to do with this note in the release notes:

ADDED: New bool parameter for the method public static Func<IDictionary, object> Compile(string code, IDictionary<string, Type> parameterTypes, bool allowWritableVariable = false). When the allowWritableVariable = true, the value within the dictionary passed to the compiled method will now be updated for expressions such as i++

our code throws on this line:

                var compiled = evalContext.Compile<Action<ExpandoObject, IDictionary<string, object>>>(
                                                                                                       mutationScript,
                                                                                                       "expando",
                                                                                                       "dict"
                                                                                                      );

there IS writing going on back to the dictionary/expando in this workflow. there is no prop on this compile method to allow writing if that's what's required.

mrtristan avatar Oct 12 '24 14:10 mrtristan

Hello @mrtristan ,

Thank you for reporting. I could be wrong, but I believe that's more related to the change for the "Raw String Literals" also in v6.2.0. Looking at the stack trace, this is the tokenizer that throws an exception, which is exactly what we touched.

Do you think you could provide a runnable example that throws the error? That will surely help us fix it faster as I don't think we have enough information to reproduce it at this moment if this is what I believe. You can send it in private here: [email protected]

Best Regards,

Jon

JonathanMagnan avatar Oct 12 '24 15:10 JonathanMagnan

Understood, thanks for the quick response. Sent an email.

mrtristan avatar Oct 12 '24 18:10 mrtristan

Hello @mrtristan ,

Thank you. We can successfully reproduce the issue. As expected, this is related to the "Raw String Literals" changes. We forgot to do something about formatting such as {SomethingCost:0.00##}.

Best Regards,

Jon

JonathanMagnan avatar Oct 14 '24 00:10 JonathanMagnan

Hello @mrtristan ,

The v6.2.1 has been released today.

Could you try it and let us know if everything has been successfully fixed?

Best Regards,

Jon

JonathanMagnan avatar Oct 22 '24 23:10 JonathanMagnan