Skip to content

Commit 74e55ea

Browse files
committed
small cleanup
1 parent 2edf360 commit 74e55ea

File tree

4 files changed

+6
-11
lines changed

4 files changed

+6
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#### :house: Internal
2020
- Use latest compiler for tests. https://github.com/rescript-lang/rescript/pull/7186
2121
- Added infra to modernise AST: theres' Parsetree, Parsetree0 (legacy), and conversion functions to keep compatibility with PPX. https://github.com/rescript-lang/rescript/pull/7185
22+
- Ast cleanup: remove exp object and exp unreachable. https://github.com/rescript-lang/rescript/pull/7189
2223

2324
# 12.0.0-alpha.5
2425

compiler/ml/parmatch.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2212,7 +2212,7 @@ let check_unused pred casel =
22122212
(*Format.eprintf "%a@." pretty_val u;*)
22132213
let pattern, constrs, labels = Conv.conv u in
22142214
let pattern = {pattern with Parsetree.ppat_loc = q.pat_loc} in
2215-
match pred false constrs labels pattern with
2215+
match pred constrs labels pattern with
22162216
| None ->
22172217
Location.prerr_warning q.pat_loc Warnings.Unreachable_case;
22182218
Used

compiler/ml/parmatch.mli

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,7 @@ val check_partial_gadt :
8484
case list ->
8585
partial
8686
val check_unused :
87-
(bool ->
88-
(string, constructor_description) Hashtbl.t ->
87+
((string, constructor_description) Hashtbl.t ->
8988
(string, label_description) Hashtbl.t ->
9089
Parsetree.pattern ->
9190
pattern option) ->

compiler/ml/typecore.ml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,14 +1750,9 @@ let check_partial ?(lev = get_current_level ()) env expected_ty loc cases =
17501750
17511751
let check_unused ?(lev = get_current_level ()) env expected_ty cases =
17521752
Parmatch.check_unused
1753-
(fun refute constrs labels spat ->
1754-
match
1755-
partial_pred ~lev ~mode:Split_or ~explode:5 env expected_ty constrs
1756-
labels spat
1757-
with
1758-
| Some pat when refute ->
1759-
raise (Error (spat.ppat_loc, env, Unrefuted_pattern pat))
1760-
| r -> r)
1753+
(fun constrs labels spat ->
1754+
partial_pred ~lev ~mode:Split_or ~explode:5 env expected_ty constrs labels
1755+
spat)
17611756
cases
17621757
17631758
let add_pattern_variables ?check ?check_as env =

0 commit comments

Comments
 (0)