summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Campbell2017-08-14 15:04:12 +0100
committerBrian Campbell2017-08-14 15:04:12 +0100
commit9650491762d389fe84aa96a63efc535bdbd9c5de (patch)
tree582482180a1e9b80c5e5efe55c2f82dec1e34e8f
parentc46c1ef29c08dc3e959228783d34e9c6ac464455 (diff)
Don't reverse lexp tuple during type checking
-rw-r--r--src/type_check.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/type_check.ml b/src/type_check.ml
index e69a40e8..dbaeb98f 100644
--- a/src/type_check.ml
+++ b/src/type_check.ml
@@ -2303,11 +2303,11 @@ and bind_lexp env (LEXP_aux (lexp_aux, (l, ())) as lexp) typ =
let (Typ_aux (typ_aux, _)) = typ in
match typ_aux with
| Typ_tup typs ->
- let bind_tuple_lexp (tlexps, env) lexp typ =
+ let bind_tuple_lexp lexp typ (tlexps, env) =
let tlexp, env = bind_lexp env lexp typ in tlexp :: tlexps, env
in
let tlexps, env =
- try List.fold_left2 bind_tuple_lexp ([], env) lexps typs with
+ try List.fold_right2 bind_tuple_lexp lexps typs ([], env) with
| Invalid_argument _ -> typ_error l "Tuple l-expression and tuple type have different length"
in
annot_lexp (LEXP_tup tlexps) typ, env