Debian Codegraph @

test/instrument/pattern/binding.t

raw
1 Bindings made under or-patterns remain consistent after instrumentation.
2
3 $ (bash ../test.sh | tail -n +4) <<'EOF'
4 > let _ =
5 > match `A with
6 > | (`A as x) | (`B as x) -> print_endline "foo"; x
7 > EOF
8 (match[@ocaml.warning "-4-8-9-11-26-27-28-33"]
9 ___bisect_matched_value___
10 with
11 | `A as x ->
12 ___bisect_visit___ 1;
13 ()
14 | `B as x ->
15 ___bisect_visit___ 2;
16 ()
17 | _ -> ());
18 ___bisect_post_visit___ 0 (print_endline "foo");
19 x
20
21 $ bash ../test.sh <<'EOF'
22 > let _ =
23 > match `A () with
24 > | `A x | `B x -> print_endline "foo"; x
25 > EOF
26 let _ =
27 match `A () with
28 | (`A x | `B x) as ___bisect_matched_value___ ->
29 (match[@ocaml.warning "-4-8-9-11-26-27-28-33"]
30 ___bisect_matched_value___
31 with
32 | `A x ->
33 ___bisect_visit___ 1;
34 ()
35 | `B x ->
36 ___bisect_visit___ 2;
37 ()
38 | _ -> ());
39 ___bisect_post_visit___ 0 (print_endline "foo");
40 x