summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlasdair Armstrong2018-04-19 15:13:10 +0100
committerAlasdair Armstrong2018-04-19 15:18:23 +0100
commitb93ae6094a95e3bfaed9196f396ea72d3d66ea74 (patch)
treef423d30be64b4428f7a1188d515383f43248d793 /test
parent725d5d7868b3b10882ee6eb2fa2f3e63212c1848 (diff)
Fix bug with function being applied to tuples
For some reason there was a desugaring rule that mapped f((x, y)) to f(x, y) in initial_check.ml, this prevented functions and constructors from being applied to tuples.
Diffstat (limited to 'test')
-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