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
It looks like FastExpressionCompiler is not comparing correctly nullable types. I didn't find any mention of it.
public static class FastExpressionCompilerTests
{
public class Test
{
public decimal? D1 { get; set; }
}
public static void RunTest()
{
Expression<Func<Test, bool>> expression = t => t.D1 < 20;
var normalCompiled = expression.Compile();
var fastCompiled = expression.CompileFast(true, CompilerFlags.EnableDelegateDebugInfo);
var test = new Test()
{
D1 = null
};
var result1 = normalCompiled(test); // false
var result2 = fastCompiled(test); // true
}
}
after execution result1 is equal false, but result2 is equal true
Activity
[-]Comparisons with nullable values[/-][+]Comparisons with nullable types[/+]dadhi commentedon Jan 15, 2024
@celi Missed this one, will look now. Thanks for posting.
dadhi commentedon Jan 19, 2024
@celi Yep, reproduced :/ Will fix.
output Method:Line for Emit in Debug; added test for #380
adding another test for #380
fixed: dadhi#380