summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/type_check.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/type_check.ml b/src/type_check.ml
index 603052b5..48a64226 100644
--- a/src/type_check.ml
+++ b/src/type_check.ml
@@ -1851,7 +1851,7 @@ let instantiate_quants quants unifier =
they'll be unambigiously unified with the argument types so it's
better to just not bother with the return type.
*)
-let rec ambiguous_vars (Typ_aux (aux, _)) =
+let rec ambiguous_vars' (Typ_aux (aux, _)) =
match aux with
| Typ_app (_, args) -> List.fold_left KidSet.union KidSet.empty (List.map ambiguous_arg_vars args)
| _ -> KidSet.empty
@@ -1876,6 +1876,10 @@ and ambiguous_nexp_vars (Nexp_aux (aux, _)) =
| Nexp_sum (nexp1, nexp2) -> KidSet.union (tyvars_of_nexp nexp1) (tyvars_of_nexp nexp2)
| _ -> KidSet.empty
+let ambiguous_vars typ =
+ let vars = ambiguous_vars' typ in
+ if KidSet.cardinal vars > 1 then vars else KidSet.empty
+
(**************************************************************************)
(* 3.5. Subtyping with existentials *)
(**************************************************************************)