Skip to content

Commit d905369

Browse files
authored
Merge pull request #2196 from BuckleScript/fix_2179
fix #2179 warning for polymoprhic comparison
2 parents 42f4fc0 + 3d2a96f commit d905369

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

jscomp/bin/whole_compiler.ml

+6-3
Original file line numberDiff line numberDiff line change
@@ -96266,19 +96266,22 @@ let translate loc (prim_name : string)
9626696266
| _ -> assert false
9626796267
end
9626896268
| "caml_obj_truncate"
96269-
| "caml_lazy_make_forward"
96270-
| "caml_compare"
96269+
| "caml_lazy_make_forward"
9627196270
| "caml_int_compare"
9627296271
| "caml_int32_compare"
9627396272
| "caml_nativeint_compare"
96273+
->
96274+
call Js_runtime_modules.obj_runtime
96275+
| "caml_compare"
9627496276
| "caml_equal"
9627596277
| "caml_notequal"
9627696278
| "caml_greaterequal"
9627796279
| "caml_greaterthan"
9627896280
| "caml_lessequal"
9627996281
| "caml_lessthan"
96280-
9628196282
->
96283+
if Warnings.is_active Warnings.Bs_polymorphic_comparison then
96284+
Location.prerr_warning loc Warnings.Bs_polymorphic_comparison ;
9628296285
call Js_runtime_modules.obj_runtime
9628396286
| "caml_obj_set_tag"
9628496287
-> begin match args with

jscomp/core/lam_dispatch_primitive.ml

+6-3
Original file line numberDiff line numberDiff line change
@@ -568,19 +568,22 @@ let translate loc (prim_name : string)
568568
| _ -> assert false
569569
end
570570
| "caml_obj_truncate"
571-
| "caml_lazy_make_forward"
572-
| "caml_compare"
571+
| "caml_lazy_make_forward"
573572
| "caml_int_compare"
574573
| "caml_int32_compare"
575574
| "caml_nativeint_compare"
575+
->
576+
call Js_runtime_modules.obj_runtime
577+
| "caml_compare"
576578
| "caml_equal"
577579
| "caml_notequal"
578580
| "caml_greaterequal"
579581
| "caml_greaterthan"
580582
| "caml_lessequal"
581583
| "caml_lessthan"
582-
583584
->
585+
if Warnings.is_active Warnings.Bs_polymorphic_comparison then
586+
Location.prerr_warning loc Warnings.Bs_polymorphic_comparison ;
584587
call Js_runtime_modules.obj_runtime
585588
| "caml_obj_set_tag"
586589
-> begin match args with

jscomp/stdlib/Makefile.shared

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ include ../Makefile.shared
3232
# endif
3333

3434
BS_FLAGS= $(BS_COMMON_FLAGS) $(BS_PKG_FLAGS)
35-
COMPFLAGS= $(BS_FLAGS) -strict-sequence -w +33..39 -g -warn-error A -nostdlib \
35+
COMPFLAGS= $(BS_FLAGS) -strict-sequence -w +33..39 -g -nostdlib \
3636
-safe-string -I ../runtime $(PROD_BS_FLAGS)
3737

3838

jscomp/test/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ $(addsuffix .cmi, $(OTHERS)): ../runtime/js.cmi
213213
$(addsuffix .cmj, $(OTHERS)): ../runtime/js.cmj
214214

215215
# It is okay to test deprecated API
216-
COMPFLAGS+= $(MODULE_FLAGS) -w -40 -warn-error A+8-3-30-26-101
216+
COMPFLAGS+= $(MODULE_FLAGS) -w -40 -warn-error A+8-3-30-26-101-102
217217
COMPFLAGS+= -bs-no-version-header -absname -bs-diagnose -bs-cross-module-opt -bs-package-name bs-platform -bs-package-output commonjs:jscomp/test
218218

219219

0 commit comments

Comments
 (0)