summaryrefslogtreecommitdiff
path: root/testsuite/tests/tmc/partial_application.ml
blob: 7721416f828a546ed85794373e075652a0dba52e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(* TEST
   * bytecode
   * native
*)
type t = Ret of (unit -> unit) | Next of t

let[@tail_mod_cons] rec f () () = ()

and[@tail_mod_cons] g ~first:b =
  if b then Next (g ~first:false)
  else
    (* The call below is in TMC position but partially-applied;
       we should not compile it like a TMC call. *)
    Ret (f ())

let () =
  match g ~first:true with
  | Next (Ret f) -> f ()
  | _ -> assert false