diff options
| author | Alasdair Armstrong | 2019-02-04 16:43:32 +0000 |
|---|---|---|
| committer | Alasdair Armstrong | 2019-02-04 16:43:32 +0000 |
| commit | 4910e06ae9cf8f479c76fea39b4334407942da4e (patch) | |
| tree | 6d39cecf2352b9584b48e61df24556b419df055e /test | |
| parent | ebfed17b57993f034d1a334014a8b9c9a542c0d5 (diff) | |
Fix behavior for fallthrough cases in catch blocks
Make all backends behave the same when a catch block does not catch a
specific exception.
Diffstat (limited to 'test')
| -rw-r--r-- | test/c/fallthrough_exception.expect | 1 | ||||
| -rw-r--r-- | test/c/fallthrough_exception.sail | 20 |
2 files changed, 21 insertions, 0 deletions
diff --git a/test/c/fallthrough_exception.expect b/test/c/fallthrough_exception.expect new file mode 100644 index 00000000..6d9de85e --- /dev/null +++ b/test/c/fallthrough_exception.expect @@ -0,0 +1 @@ +E2 diff --git a/test/c/fallthrough_exception.sail b/test/c/fallthrough_exception.sail new file mode 100644 index 00000000..6260a603 --- /dev/null +++ b/test/c/fallthrough_exception.sail @@ -0,0 +1,20 @@ +default Order dec + +$include <prelude.sail> + +val print = "print_endline" : string -> unit + +union exception = { + E1 : unit, + E2 : unit +} + +function main((): unit) -> unit = { + try { + try throw(E2()) catch { + E1() => print("E1") + } + } catch { + E2() => print("E2") + } +}
\ No newline at end of file |
