summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/typecheck/pass/if_return.sail14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/typecheck/pass/if_return.sail b/test/typecheck/pass/if_return.sail
new file mode 100644
index 00000000..9b373c2d
--- /dev/null
+++ b/test/typecheck/pass/if_return.sail
@@ -0,0 +1,14 @@
+$option -non_lexical_flow
+
+default Order dec
+
+$include <prelude.sail>
+
+val foo : forall 'n, 'n != 8. int('n) -> unit
+
+function test(y: int) -> unit = {
+ if y == 8 then {
+ return();
+ };
+ foo(y)
+}