From 35bfe5b1c08fb045283785c819bf0ec4fe24f1c0 Mon Sep 17 00:00:00 2001 From: Brian Campbell Date: Tue, 9 Jan 2018 11:33:04 +0000 Subject: Move reordering in alpha_equivalent before relabelling to give consistent names --- src/type_check.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/type_check.ml b/src/type_check.ml index dee17fee..a4b4bb39 100644 --- a/src/type_check.ml +++ b/src/type_check.ml @@ -1613,11 +1613,11 @@ let rec alpha_equivalent env typ1 typ2 = | Typ_fn (typ1, typ2, eff) -> Typ_fn (relabel typ1, relabel typ2, eff) | Typ_tup typs -> Typ_tup (List.map relabel typs) | Typ_exist (kids, nc, typ) -> + let (kids, _) = kid_order (KidSet.of_list kids) typ in let kids = List.map (fun kid -> (kid, new_kid ())) kids in let nc = List.fold_left (fun nc (kid, nk) -> nc_subst_nexp kid (Nexp_var nk) nc) nc kids in let typ = List.fold_left (fun nc (kid, nk) -> typ_subst_nexp kid (Nexp_var nk) nc) typ kids in let kids = List.map snd kids in - let (kids, _) = kid_order (KidSet.of_list kids) typ in Typ_exist (kids, nc, typ) | Typ_app (id, args) -> Typ_app (id, List.map relabel_arg args) -- cgit v1.2.3