Skip to content

Commit c008f88

Browse files
committed
fix loc and put error case first for better errors
1 parent 740322b commit c008f88

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/frontend/bs_builtin_ppx.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
180180
pc_rhs = body;
181181
}
182182
in
183-
let loc = Location.none in
183+
let loc = {pvb_pat.ppat_loc with loc_ghost = true} in
184184
let error_case =
185185
match variant with
186186
| `Result ->
@@ -209,7 +209,7 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
209209
default_expr_mapper self
210210
{
211211
e with
212-
pexp_desc = Pexp_match (pvb_expr, [ok_case; error_case]);
212+
pexp_desc = Pexp_match (pvb_expr, [error_case; ok_case]);
213213
pexp_attributes = e.pexp_attributes @ pvb_attributes;
214214
})
215215
| Pexp_let

0 commit comments

Comments
 (0)