We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a937c43 commit ee289bcCopy full SHA for ee289bc
1 file changed
compiler/ml/translcore.ml
@@ -419,8 +419,8 @@ let is_null_undefined_constant (exp : Typedtree.expression) =
419
| _ -> false
420
421
let warn_on_polymorphic_comparison loc prim_name args = function
422
- (* Preserve the backend's old exemption for == / != against nullish constants,
423
- which compile to dedicated null/undefined checks rather than object compare. *)
+ (* Skip warning 102 for `==` / `!=` when one side is a nullish constant:
+ those cases lower to dedicated null/undefined checks, not object comparison. *)
424
| Pobjcomp (Ceq | Cneq)
425
when prim_name = "%equal_null"
426
|| prim_name = "%equal_undefined"
0 commit comments