This repository has been archived by the owner on Sep 5, 2023. It is now read-only.
literalExpressionEvaluator binary operations with booleans #838
Labels
good first issue
Good for newcomers
In the literalExpressionEvaluator pass, a binary expression could be calculated at compile time, even when only one argument is a literal. In the case of a boolean literal with the
&&
operator, the following is done:It is also known that if
notNullMember
istrue
, the result of the operation is the other member, and so the binaryOperation expression can be replaced by the left or right expression correspondingly. This is something that could be added.Same thing happens for
||
operatorAdd tests for this behaviour
The text was updated successfully, but these errors were encountered: