| ... | ... | @@ -28462,10 +28462,12 @@ fn cmpNumeric( |
| 28462 | 28462 | if (try sema.resolveMaybeUndefVal(rhs)) |rhs_val| { |
| 28463 | 28463 | // Compare ints: const vs. undefined (or vice versa) |
| 28464 | 28464 | if (!lhs_val.isUndef() and (lhs_ty.isInt() or lhs_ty_tag == .ComptimeInt) and rhs_ty.isInt() and rhs_val.isUndef()) { |
| 28465 | try sema.resolveLazyValue(lhs_val); |
| 28465 | 28466 | if (sema.compareIntsOnlyPossibleResult(target, lhs_val, op, rhs_ty)) |res| { |
| 28466 | 28467 | return if (res) Air.Inst.Ref.bool_true else Air.Inst.Ref.bool_false; |
| 28467 | 28468 | } |
| 28468 | 28469 | } else if (!rhs_val.isUndef() and (rhs_ty.isInt() or rhs_ty_tag == .ComptimeInt) and lhs_ty.isInt() and lhs_val.isUndef()) { |
| 28470 | try sema.resolveLazyValue(rhs_val); |
| 28469 | 28471 | if (sema.compareIntsOnlyPossibleResult(target, rhs_val, op.reverse(), lhs_ty)) |res| { |
| 28470 | 28472 | return if (res) Air.Inst.Ref.bool_true else Air.Inst.Ref.bool_false; |
| 28471 | 28473 | } |
| ... | ... | @@ -28489,6 +28491,7 @@ fn cmpNumeric( |
| 28489 | 28491 | } else { |
| 28490 | 28492 | if (!lhs_val.isUndef() and (lhs_ty.isInt() or lhs_ty_tag == .ComptimeInt) and rhs_ty.isInt()) { |
| 28491 | 28493 | // Compare ints: const vs. var |
| 28494 | try sema.resolveLazyValue(lhs_val); |
| 28492 | 28495 | if (sema.compareIntsOnlyPossibleResult(target, lhs_val, op, rhs_ty)) |res| { |
| 28493 | 28496 | return if (res) Air.Inst.Ref.bool_true else Air.Inst.Ref.bool_false; |
| 28494 | 28497 | } |
| ... | ... | @@ -28499,6 +28502,7 @@ fn cmpNumeric( |
| 28499 | 28502 | if (try sema.resolveMaybeUndefVal(rhs)) |rhs_val| { |
| 28500 | 28503 | if (!rhs_val.isUndef() and (rhs_ty.isInt() or rhs_ty_tag == .ComptimeInt) and lhs_ty.isInt()) { |
| 28501 | 28504 | // Compare ints: var vs. const |
| 28505 | try sema.resolveLazyValue(rhs_val); |
| 28502 | 28506 | if (sema.compareIntsOnlyPossibleResult(target, rhs_val, op.reverse(), lhs_ty)) |res| { |
| 28503 | 28507 | return if (res) Air.Inst.Ref.bool_true else Air.Inst.Ref.bool_false; |
| 28504 | 28508 | } |