From e5361b1e3e012fe3436609afb65af92913b8ebfe Mon Sep 17 00:00:00 2001 From: Hongbo Zhang Date: Mon, 24 Oct 2022 10:04:15 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"Fix=20issue=20where=20exhaustiveness?= =?UTF-8?q?=20check=20for=20pattern=20matching=20char=20was=20no=E2=80=A6?= =?UTF-8?q?=20(#5744)"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a8b0cfb3e056c138f7e7f0994e3cb105e654ea9d. --- CHANGELOG.md | 4 ---- jscomp/ml/typecore.ml | 5 ----- lib/4.06.1/unstable/js_compiler.ml | 5 ----- lib/4.06.1/unstable/js_playground_compiler.ml | 5 ----- lib/4.06.1/whole_compiler.ml | 5 ----- 5 files changed, 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71c7d3be11..f238068159 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,10 +12,6 @@ # 10.1.0-rc.3 -#### :bug: Bug Fix - -- Fix issue where exhaustiveness check for pattern matching char was not working https://github.com/rescript-lang/rescript-compiler/issues/5557 - # 10.1.0-rc.2 #### :bug: Bug Fix diff --git a/jscomp/ml/typecore.ml b/jscomp/ml/typecore.ml index 4dbc11b7c7..012cdd765c 100644 --- a/jscomp/ml/typecore.ml +++ b/jscomp/ml/typecore.ml @@ -1350,11 +1350,6 @@ let partial_pred ~lev ?mode ?explode env expected_ty constrs labels p = let state = save_state env in try reset_pattern None true; - let expected_ty = match p.ppat_desc, expected_ty.desc with - | Ppat_constant (Pconst_integer _ ), Tconstr (path, [], _) when Path.same path Predef.path_char -> - (* Constants such as 'x' are represented as Pconst_integer but expected to have type char *) - Predef.type_int - | _ -> expected_ty in let typed_p = Ctype.with_passive_variants (type_pat ~allow_existentials:true ~lev diff --git a/lib/4.06.1/unstable/js_compiler.ml b/lib/4.06.1/unstable/js_compiler.ml index d4dca29dfe..0e6879f617 100644 --- a/lib/4.06.1/unstable/js_compiler.ml +++ b/lib/4.06.1/unstable/js_compiler.ml @@ -40301,11 +40301,6 @@ let partial_pred ~lev ?mode ?explode env expected_ty constrs labels p = let state = save_state env in try reset_pattern None true; - let expected_ty = match p.ppat_desc, expected_ty.desc with - | Ppat_constant (Pconst_integer _ ), Tconstr (path, [], _) when Path.same path Predef.path_char -> - (* Constants such as 'x' are represented as Pconst_integer but expected to have type char *) - Predef.type_int - | _ -> expected_ty in let typed_p = Ctype.with_passive_variants (type_pat ~allow_existentials:true ~lev diff --git a/lib/4.06.1/unstable/js_playground_compiler.ml b/lib/4.06.1/unstable/js_playground_compiler.ml index 22e7d91b52..314e28560a 100644 --- a/lib/4.06.1/unstable/js_playground_compiler.ml +++ b/lib/4.06.1/unstable/js_playground_compiler.ml @@ -40301,11 +40301,6 @@ let partial_pred ~lev ?mode ?explode env expected_ty constrs labels p = let state = save_state env in try reset_pattern None true; - let expected_ty = match p.ppat_desc, expected_ty.desc with - | Ppat_constant (Pconst_integer _ ), Tconstr (path, [], _) when Path.same path Predef.path_char -> - (* Constants such as 'x' are represented as Pconst_integer but expected to have type char *) - Predef.type_int - | _ -> expected_ty in let typed_p = Ctype.with_passive_variants (type_pat ~allow_existentials:true ~lev diff --git a/lib/4.06.1/whole_compiler.ml b/lib/4.06.1/whole_compiler.ml index 0ec973290c..396eb85143 100644 --- a/lib/4.06.1/whole_compiler.ml +++ b/lib/4.06.1/whole_compiler.ml @@ -216688,11 +216688,6 @@ let partial_pred ~lev ?mode ?explode env expected_ty constrs labels p = let state = save_state env in try reset_pattern None true; - let expected_ty = match p.ppat_desc, expected_ty.desc with - | Ppat_constant (Pconst_integer _ ), Tconstr (path, [], _) when Path.same path Predef.path_char -> - (* Constants such as 'x' are represented as Pconst_integer but expected to have type char *) - Predef.type_int - | _ -> expected_ty in let typed_p = Ctype.with_passive_variants (type_pat ~allow_existentials:true ~lev