summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/initial_check.ml3
-rw-r--r--test/typecheck/pass/option_tuple.sail11
2 files changed, 12 insertions, 2 deletions
diff --git a/src/initial_check.ml b/src/initial_check.ml
index c6bc5fbe..62c1af02 100644
--- a/src/initial_check.ml
+++ b/src/initial_check.ml
@@ -493,8 +493,7 @@ and to_ast_exp (k_env : kind Envmap.t) (def_ord : order) (Parse_ast.E_aux(exp,l)
| Parse_ast.E_app(f,args) ->
(match List.map (to_ast_exp k_env def_ord) args with
| [] -> E_app(to_ast_id f, [])
- | [E_aux(E_tuple(exps),_)] -> E_app(to_ast_id f, exps)
- | exps -> E_app(to_ast_id f, exps))
+ | exps -> E_app(to_ast_id f, exps))
| Parse_ast.E_app_infix(left,op,right) ->
E_app_infix(to_ast_exp k_env def_ord left, to_ast_id op, to_ast_exp k_env def_ord right)
| Parse_ast.E_tuple(exps) -> E_tuple(List.map (to_ast_exp k_env def_ord) exps)
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