summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--typing/env.ml3
-rw-r--r--typing/mtype.ml4
-rw-r--r--typing/printtyp.ml3
3 files changed, 6 insertions, 4 deletions
diff --git a/typing/env.ml b/typing/env.ml
index 1a80da9e5..bfa73e7d5 100644
--- a/typing/env.ml
+++ b/typing/env.ml
@@ -262,7 +262,8 @@ and find_cltype =
let find_type_expansion path env =
let decl = find_type path env in
match decl.type_manifest with
- | Some body when decl.type_private = Public -> (decl.type_params, body)
+ | Some body when decl.type_private = Public || Btype.has_constr_row body ->
+ (decl.type_params, body)
| _ -> raise Not_found
let find_modtype_expansion path env =
diff --git a/typing/mtype.ml b/typing/mtype.ml
index ac5e2424a..bbf43179d 100644
--- a/typing/mtype.ml
+++ b/typing/mtype.ml
@@ -50,7 +50,9 @@ and strengthen_sig env sg p =
match decl.type_manifest with
Some ty when not (Btype.has_constr_row ty) -> decl
| _ ->
- { decl with type_manifest =
+ { decl with
+ type_private = Asttypes.Public;
+ type_manifest =
Some(Btype.newgenty(Tconstr(Pdot(p, Ident.name id, nopos),
decl.type_params, ref Mnil))) }
in
diff --git a/typing/printtyp.ml b/typing/printtyp.ml
index 242765e34..c6aec4fc8 100644
--- a/typing/printtyp.ml
+++ b/typing/printtyp.ml
@@ -564,8 +564,7 @@ let rec tree_of_type_decl id decl =
begin match ty_manifest with
| None -> (Otyp_abstract, Public)
| Some ty ->
- tree_of_typexp false ty,
- (if has_constr_row ty then Private else decl.type_private)
+ tree_of_typexp false ty, decl.type_private
end
| Type_variant cstrs ->
tree_of_manifest (Otyp_sum (List.map tree_of_constructor cstrs)),