Checking a property of an input (parameter) object for null stopped working in 2.17.1.
This worked fine in 2.16.1.
var options = InterpreterOptions.DefaultCaseInsensitive | InterpreterOptions.LambdaExpressions | InterpreterOptions.LateBindObject;
var interpreter = new Interpreter(options);
var input = new
{
//Prop1 = (object?)null, // works
Prop1 = new { }, // does not matter what type
};
var expressionDelegate = interpreter.ParseAsDelegate<Func<object, bool>>($"input.Prop1 == null", "input")!;
// var expressionDelegate = interpreter.ParseAsDelegate<Func<object, bool>>($"input.Prop1 == (object)null", "input")!; // also works
var value = expressionDelegate(input); // exception
With 2.17.1 this throws an exception:
System.InvalidCastException : Unable to cast object of type '<>f__AnonymousType2' to type 'System.Nullable`1[System.Boolean]'.
Checking a property of an input (parameter) object for null stopped working in 2.17.1.
This worked fine in 2.16.1.
With 2.17.1 this throws an exception:
System.InvalidCastException : Unable to cast object of type '<>f__AnonymousType2' to type 'System.Nullable`1[System.Boolean]'.