blob: b805f3fa26c7475fe6721aed5186c0d37918053c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
scattered union exception
union clause exception = Test_int : int
union clause exception = Test_failure : string
val main : unit -> unit effect {escape}
function main () = {
try {
print("Before throw");
throw(Test_failure("Caught!"));
print("Not printed")
} catch {
Test_failure(msg) => print(msg),
_ => print("Unknown exception")
}
}
union clause exception = Test_other
end exception
|