diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/typecheck/pass/trycatch.sail | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/typecheck/pass/trycatch.sail b/test/typecheck/pass/trycatch.sail new file mode 100644 index 00000000..b7f97dd0 --- /dev/null +++ b/test/typecheck/pass/trycatch.sail @@ -0,0 +1,20 @@ + +scattered typedef exception = const union + +union exception member int IntEx + +val unit -> unit effect {escape} test2 + +function test2 () = throw (IntEx(3)) + +val unit -> unit effect {escape} test + +function test () = + try { + test2(); + () + } catch { + case (IntEx(_)) -> () + } + +end exception |
