aboutsummaryrefslogtreecommitdiffstats
path: root/progs
diff options
context:
space:
mode:
Diffstat (limited to 'progs')
-rw-r--r--progs/tests/union_types_simple.sy13
1 files changed, 13 insertions, 0 deletions
diff --git a/progs/tests/union_types_simple.sy b/progs/tests/union_types_simple.sy
index 490717e..f6cf622 100644
--- a/progs/tests/union_types_simple.sy
+++ b/progs/tests/union_types_simple.sy
@@ -14,10 +14,23 @@ g :: fn a:bool -> int | (bool, bool) {
}
}
+h :: fn a:bool -> int | fn -> int {
+ if a {
+ f :: fn -> int { ret 1 }
+ ret f
+ } else {
+ ret 1
+ }
+}
+
start :: fn {
1 <=> f! true
nil <=> f! false
(true, true) <=> g! false
1 <=> g! true
f(true) <=> g(true)
+
+ 1 <=> h! false
+ q :: h! true
+ 1 <=> q()
}