From b93ae6094a95e3bfaed9196f396ea72d3d66ea74 Mon Sep 17 00:00:00 2001 From: Alasdair Armstrong Date: Thu, 19 Apr 2018 15:13:10 +0100 Subject: 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. --- test/typecheck/pass/option_tuple.sail | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/typecheck/pass/option_tuple.sail (limited to 'test') 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 -- cgit v1.2.3