summaryrefslogtreecommitdiff
path: root/test/c/poly_pair.sail
blob: c4989829c2b1478d9730c975dadae4c337879701 (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")
  };
}