diff --git a/src/ppx/instrument.ml b/src/ppx/instrument.ml index e6243050..f9301a77 100644 --- a/src/ppx/instrument.ml +++ b/src/ppx/instrument.ml @@ -1255,9 +1255,6 @@ class instrumenter = in Exp.poly ~loc ~attrs e t - | Pexp_newtype (t, e) -> - Exp.newtype ~loc ~attrs t (traverse ~is_in_tail_position:true e) - | Pexp_letop {let_; ands; body} -> let traverse_binding_op binding_op = {binding_op with @@ -1363,6 +1360,9 @@ class instrumenter = (self#open_declaration m) (traverse ~is_in_tail_position e) + | Pexp_newtype (t, e) -> + Exp.newtype ~loc ~attrs t (traverse ~is_in_tail_position e) + (* Expressions that don't need instrumentation, and where AST traversal leaves the expression language. *) | Pexp_object c -> diff --git a/test/instrument/control/newtype.t b/test/instrument/control/newtype.t index 53e3182f..630a122d 100644 --- a/test/instrument/control/newtype.t +++ b/test/instrument/control/newtype.t @@ -25,9 +25,9 @@ Subexpression in tail position iff whole expression is in tail position. > let _ = fun () -> > fun (type _t) -> print_endline "foo" > EOF - let _ = fun (type _t) -> print_endline "foo" + let _ = fun (type _t) -> ___bisect_post_visit___ 0 (print_endline "foo") let _ = fun () -> - ___bisect_visit___ 0; + ___bisect_visit___ 1; fun (type _t) -> print_endline "foo"