diff options
| author | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2003-05-14 09:48:20 +0000 |
|---|---|---|
| committer | Jacques Garrigue <garrigue at math.nagoya-u.ac.jp> | 2003-05-14 09:48:20 +0000 |
| commit | 4d7abfbc16022eab8af392bd3e6d76cf4773f2c2 (patch) | |
| tree | e883430c77d37c7c933652bca86be8dcc3697272 /typing/subst.ml | |
| parent | 6ef3a9c5a2ca32049682798e1e6f4521ea196836 (diff) | |
| download | ocaml-multimatch.tar.gz | |
merge from HEADmultimatch
git-svn-id: http://caml.inria.fr/svn/ocaml/branches/multimatch@5563 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'typing/subst.ml')
| -rw-r--r-- | typing/subst.ml | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/typing/subst.ml b/typing/subst.ml index 32452902ba..8225877953 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 @@ -154,8 +154,9 @@ let type_declaration s decl = { type_params = List.map (typexp s) decl.type_params; type_arity = decl.type_arity; type_kind = - begin match decl.type_kind with - Type_abstract -> Type_abstract + begin + let rec kind_of_tkind = function + | Type_abstract -> Type_abstract | Type_variant cstrs -> Type_variant( List.map (fun (n, args) -> (n, List.map (typexp s) args)) @@ -165,6 +166,8 @@ let type_declaration s decl = List.map (fun (n, mut, arg) -> (n, mut, typexp s arg)) lbls, rep) + | Type_private tkind -> Type_private (kind_of_tkind tkind) in + kind_of_tkind decl.type_kind end; type_manifest = begin match decl.type_manifest with |
