Skip to content

Commit

Permalink
Issue #138: Fix implicit casting RHS with greater operator
Browse files Browse the repository at this point in the history
  • Loading branch information
AmrDeveloper committed Jan 3, 2025
1 parent 0f3429c commit cd5f766
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/gitql-parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2531,7 +2531,7 @@ fn parse_comparison_expression(
let lhs_type = lhs.expr_type();
let rhs_type = rhs.expr_type();

// Parse and Check sides for `<` operator
// Parse and Check sides for `>` operator
if operator.kind == TokenKind::Greater {
let expected_rhs_types = lhs_type.can_perform_gt_op_with();

Expand All @@ -2547,7 +2547,7 @@ fn parse_comparison_expression(
// Check if RHS expr can be implicit casted to Expected LHS type to make this
// Expression valid
for expected_type in expected_rhs_types.iter() {
if !expected_type.has_implicit_cast_from(&lhs) {
if !expected_type.has_implicit_cast_from(&rhs) {
continue;
}

Expand Down

0 comments on commit cd5f766

Please sign in to comment.