Skip to content

Commit e43ba8b

Browse files
committed
fix #5557
1 parent 7d15ea8 commit e43ba8b

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@
2828

2929
- Fix issue where async as an id cannot be used with application and labelled arguments https://github.com/rescript-lang/syntax/issues/707
3030

31+
- Fix 5557 the exhaustive checking for Char is incorrect during the unicode migration
32+
33+
- Fix 5753 the comment for unicode char is inaccurate
34+
3135
# 10.1.0-rc.2
3236

3337
#### :bug: Bug Fix

jscomp/ml/parmatch.ml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ let build_other_constant proj make first next p env =
10371037

10381038
let some_other_tag = "<some other tag>"
10391039

1040-
let build_other ext env = match env with
1040+
let build_other ext env : Typedtree.pattern = match env with
10411041
| ({pat_desc = Tpat_construct (lid, {cstr_tag=Cstr_extension _},_)},_) :: _ ->
10421042
(* let c = {c with cstr_name = "*extension*"} in *) (* PR#7330 *)
10431043
make_pat (Tpat_var (Ident.create "*extension*",
@@ -1079,13 +1079,19 @@ let build_other ext env = match env with
10791079
make_pat (Tpat_or (pat, p_res, None)) p.pat_type p.pat_env)
10801080
pat other_pats
10811081
end
1082-
| ({pat_desc=(Tpat_constant (Const_int _ | Const_char _))} as p,_) :: _ ->
1082+
| ({pat_desc=(Tpat_constant (Const_int _ ))} as p,_) :: _ ->
10831083
build_other_constant
10841084
(function Tpat_constant(Const_int i) -> i
1085-
| Tpat_constant (Const_char i) -> Char.code i
10861085
| _ -> assert false)
10871086
(function i -> Tpat_constant(Const_int i))
10881087
0 succ p env
1088+
| ({pat_desc=(Tpat_constant (Const_char _ ))} as p,_) :: _ ->
1089+
build_other_constant
1090+
(function
1091+
| Tpat_constant (Const_char i) -> i
1092+
| _ -> assert false)
1093+
(function i -> Tpat_constant(Const_char i))
1094+
0 succ p env
10891095
| ({pat_desc=(Tpat_constant (Const_int32 _))} as p,_) :: _ ->
10901096
build_other_constant
10911097
(function Tpat_constant(Const_int32 i) -> i | _ -> assert false)

jscomp/napkin/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@
5959
#### :nail_care Polish
6060

6161
- Change the internal representation of props for the lowercase components to record. https://github.com/rescript-lang/syntax/pull/665
62+
- Change the payload of Pconst_char for type safety. https://github.com/rescript-lang/rescript-compiler/pull/5759
6263

6364
## ReScript 10.0
6465

0 commit comments

Comments
 (0)