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

$include <prelude.sail>

val "print_endline" : string -> unit

function test () : unit -> option(int) = {
  match Some(3) {
    Some(_) as x => x,
    _ => None()
  }
}

function main() : unit -> unit = {
  match test() {
    Some(3) => print_endline("ok"),
    _ => print_endline("fail")
  }
}