Skip to content

Comparisons with nullable types #558

Description

@celi

Hi, code like this

        decimal? d1 = null;
        var result = d1 < 20;

run in c# return false, but same comparison run in RulesEngine return true, why?

Activity

  1. celi commented on Nov 30, 2023

    @celi
    Author

    I found that FastExpressionCompiler changes this behavior.

    Changing line

    return wrappedExpression.CompileFast();

    to

    return wrappedExpression.Compile();
    

    fix this problem.

    This is bug for me.

  2. celi commented on Nov 30, 2023

    @celi
    Author
  3. changed the title [-]Comparisons with nullable values[/-] [+]Comparisons with nullable types[/+] on Dec 5, 2023
  4. abbasc52 commented on Jan 3, 2024

    @abbasc52

    celi i can maybe add option to disable fast compile if needed, it will be a tradeoff between performance vs accuracy
    Would that work for you?

  5. celi commented on Jan 3, 2024

    @celi
    Author

    Abbas Cyclewala (@abbasc52) Yes, please.
    I didn't test decrease of performance without FastExpressionCompiler yet, but I plan to do that. It will be easier with this switch.

  6. abbasc52 commented on Jan 12, 2024

    @abbasc52

    celi can you share complete sample code to reproduce this issue?

  7. celi commented on Jan 12, 2024

    @celi
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions