You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingCodingSeb.ExpressionEvaluator;ExpressionEvaluatoree=newExpressionEvaluator();ee.Variables["A"]=newDictionary<string,FileStream>();System.Console.WriteLine(ee.Evaluate<bool>("A.TryGetValue(\"NotExist\", out FileStream fs) && fs.SafeFileHandle.IsAsync == true"));
executing this raises an exception saying:
Unhandled exception. CodingSeb.ExpressionEvaluator.ExpressionEvaluatorSyntaxErrorException: Invalid character [61:=]
at CodingSeb.ExpressionEvaluator.ExpressionEvaluator.Evaluate(String expression)
at CodingSeb.ExpressionEvaluator.ExpressionEvaluator.Evaluate[T](String expression)
at Program.<Main>$(String[] args) in /home/itf/reproduce_bug/Program.cs:line 7
If I change the code to
System.Console.WriteLine(ee.Evaluate<bool>("A.TryGetValue(\"NotExist\", out FileStream fs) && fs.SafeFileHandle == true"));
it works perfectly. None of the types of the variables and properties matter here. It solely dependent on how many levels of reference I write. I realize there is an issue about logical operators not being short-circuit, but it has to be something else as it works well if I write zero or one property references, and it also needs the ==, != or possibly other operator to fail. (only checked for == and !=)
Hello! I don't really know how to name this issue, but I experience a bug, which can be easily reproduced as the following:
then in the Program.cs write:
executing this raises an exception saying:
If I change the code to
it works perfectly. None of the types of the variables and properties matter here. It solely dependent on how many levels of reference I write. I realize there is an issue about logical operators not being short-circuit, but it has to be something else as it works well if I write zero or one property references, and it also needs the ==, != or possibly other operator to fail. (only checked for == and !=)
These also works:
This however not:
Can it be fixed? :)
P.S. I'm on .NET 6.0.202
The text was updated successfully, but these errors were encountered: