Skip to content

Commit b9d832d

Browse files
committed
move to more correct place
1 parent 0d067f1 commit b9d832d

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

compiler/frontend/bs_builtin_ppx.ml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,21 +143,12 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
143143
] ) ->
144144
default_expr_mapper self
145145
{e with pexp_desc = Pexp_ifthenelse (b, t_exp, Some f_exp)}
146-
(* Transform:
146+
(* Transform:
147147
- `@let.unwrap let Ok(inner_pat) = expr`
148148
- `@let.unwrap let Error(inner_pat) = expr`
149149
- `@let.unwrap let Some(inner_pat) = expr`
150150
- `@let.unwrap let None = expr`
151151
...into switches *)
152-
| Pexp_let (_, [{pvb_pat; pvb_attributes}], _)
153-
when Ast_attributes.has_unwrap_attr pvb_attributes ->
154-
if not (Experimental_features.is_enabled Experimental_features.LetUnwrap)
155-
then
156-
Bs_syntaxerr.err pvb_pat.ppat_loc
157-
(Experimental_feature_not_enabled LetUnwrap)
158-
else
159-
Bs_syntaxerr.err pvb_pat.ppat_loc
160-
(LetUnwrap_not_supported_in_position `Unsupported_type)
161152
| Pexp_let
162153
( Nonrecursive,
163154
[
@@ -260,6 +251,15 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
260251
pexp_desc = Pexp_match (pvb_expr, [early_case; cont_case]);
261252
pexp_attributes = e.pexp_attributes @ pvb_attributes;
262253
})
254+
| Pexp_let (_, [{pvb_pat; pvb_attributes}], _)
255+
when Ast_attributes.has_unwrap_attr pvb_attributes ->
256+
if not (Experimental_features.is_enabled Experimental_features.LetUnwrap)
257+
then
258+
Bs_syntaxerr.err pvb_pat.ppat_loc
259+
(Experimental_feature_not_enabled LetUnwrap)
260+
else
261+
Bs_syntaxerr.err pvb_pat.ppat_loc
262+
(LetUnwrap_not_supported_in_position `Unsupported_type)
263263
| Pexp_let
264264
( Nonrecursive,
265265
[

0 commit comments

Comments
 (0)