diff options
-rw-r--r-- | typing/ctype.ml | 2 | ||||
-rw-r--r-- | typing/subst.ml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/typing/ctype.ml b/typing/ctype.ml index 78f71f1c6..ab6e13927 100644 --- a/typing/ctype.ml +++ b/typing/ctype.ml @@ -761,7 +761,7 @@ let rec copy ty = let more = repr row.row_more in (* We must substitute in a subtle way *) begin match more.desc with - Tsubst ({desc=Tvariant _} as ty2) -> + Tsubst ty2 when (repr ty2).desc <> Tunivar -> (* This variant type has been already copied *) ty.desc <- Tsubst ty2; (* avoid Tlink in the new type *) Tlink ty2 diff --git a/typing/subst.ml b/typing/subst.ml index 99e6d7634..822587795 100644 --- a/typing/subst.ml +++ b/typing/subst.ml @@ -99,7 +99,7 @@ let rec typexp s ty = let more = repr row.row_more in (* We must substitute in a subtle way *) begin match more.desc with - Tsubst ({desc=Tvariant _} as ty2) -> + Tsubst ty2 when (repr ty2).desc <> Tunivar -> (* This variant type has been already copied *) ty.desc <- Tsubst ty2; (* avoid Tlink in the new type *) Tlink ty2 |