summaryrefslogtreecommitdiff
path: root/test/typecheck
diff options
context:
space:
mode:
Diffstat (limited to 'test/typecheck')
-rw-r--r--test/typecheck/pass/option_tuple.sail11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/typecheck/pass/option_tuple.sail b/test/typecheck/pass/option_tuple.sail
new file mode 100644
index 00000000..f89bb080
--- /dev/null
+++ b/test/typecheck/pass/option_tuple.sail
@@ -0,0 +1,11 @@
+union option ('a : Type) = {None : unit, Some : 'a}
+
+function gen() -> option(nat) = None()
+
+function wrap_broken() -> option((nat, nat)) = {
+ match (gen()) {
+ Some(i) => let r = (i, i) in Some(r), /* works */
+ Some(i) => Some((i, i)), /* doesn't work */
+ None() => None()
+ }
+} \ No newline at end of file