Skip to content

Commit 6dc015e

Browse files
committed
fix loc and put error case first for better errors
1 parent 69431b4 commit 6dc015e

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
@@ -182,7 +182,7 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
182182
pc_rhs = body;
183183
}
184184
in
185-
let loc = Location.none in
185+
let loc = {pvb_pat.ppat_loc with loc_ghost = true} in
186186
let error_case =
187187
match variant with
188188
| `Result ->
@@ -211,7 +211,7 @@ let expr_mapper ~async_context ~in_function_def (self : mapper)
211211
default_expr_mapper self
212212
{
213213
e with
214-
pexp_desc = Pexp_match (pvb_expr, [ok_case; error_case]);
214+
pexp_desc = Pexp_match (pvb_expr, [error_case; ok_case]);
215215
pexp_attributes = e.pexp_attributes @ pvb_attributes;
216216
})
217217
| Pexp_let

0 commit comments

Comments
 (0)