summaryrefslogtreecommitdiff
path: root/testsuite/tests/local-functions/tupled2.ml
blob: e1564980d6423ae7fe34366c0f05c1230bfa7508 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(* TEST
*)

(* PR#8705 *)

let test x =
  let tupled (x, y) = (); fun () -> [|x; y|] in
  match x with
  | None -> [| |]
  | Some (x, y) -> tupled (x, y) ()

let expected = "Hello "

let result = (test (Some (expected, "World!"))).(0)

let () = assert (String.equal expected result)