summaryrefslogtreecommitdiff
path: root/test/c/poly_pair.sail
blob: 6d0bdaad4d253762e15c989f20237c53cd2e9872 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
default Order dec

val print = "print_endline" : string -> unit

val "eq_int" : (int, int) -> bool

union test ('a : Type) ('b : Type) = {
  Ctor1 : ('a, 'b),
  Ctor2 : int
}

val main : unit -> unit

function main() = {
  let x = Ctor1(3, 2);
  match x {
    Ctor1(y, z) if eq_int(y, 3) => print("1"),
    _ => print("2")
  };
}