Skip to content

Commit

Permalink
fix #5557
Browse files Browse the repository at this point in the history
  • Loading branch information
bobzhang committed Oct 31, 2022
1 parent 7d15ea8 commit e43ba8b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@

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

- Fix 5557 the exhaustive checking for Char is incorrect during the unicode migration

- Fix 5753 the comment for unicode char is inaccurate

# 10.1.0-rc.2

#### :bug: Bug Fix
Expand Down
12 changes: 9 additions & 3 deletions jscomp/ml/parmatch.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,7 @@ let build_other_constant proj make first next p env =

let some_other_tag = "<some other tag>"

let build_other ext env = match env with
let build_other ext env : Typedtree.pattern = match env with
| ({pat_desc = Tpat_construct (lid, {cstr_tag=Cstr_extension _},_)},_) :: _ ->
(* let c = {c with cstr_name = "*extension*"} in *) (* PR#7330 *)
make_pat (Tpat_var (Ident.create "*extension*",
Expand Down Expand Up @@ -1079,13 +1079,19 @@ let build_other ext env = match env with
make_pat (Tpat_or (pat, p_res, None)) p.pat_type p.pat_env)
pat other_pats
end
| ({pat_desc=(Tpat_constant (Const_int _ | Const_char _))} as p,_) :: _ ->
| ({pat_desc=(Tpat_constant (Const_int _ ))} as p,_) :: _ ->
build_other_constant
(function Tpat_constant(Const_int i) -> i
| Tpat_constant (Const_char i) -> Char.code i
| _ -> assert false)
(function i -> Tpat_constant(Const_int i))
0 succ p env
| ({pat_desc=(Tpat_constant (Const_char _ ))} as p,_) :: _ ->
build_other_constant
(function
| Tpat_constant (Const_char i) -> i
| _ -> assert false)
(function i -> Tpat_constant(Const_char i))
0 succ p env
| ({pat_desc=(Tpat_constant (Const_int32 _))} as p,_) :: _ ->
build_other_constant
(function Tpat_constant(Const_int32 i) -> i | _ -> assert false)
Expand Down
1 change: 1 addition & 0 deletions jscomp/napkin/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
#### :nail_care Polish

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

## ReScript 10.0

Expand Down

0 comments on commit e43ba8b

Please sign in to comment.