diff options
-rw-r--r-- | Changes | 2 | ||||
-rw-r--r-- | testsuite/tests/typing-private-bugs/pr5469_ok.ml | 7 | ||||
-rw-r--r-- | typing/mtype.ml | 5 |
3 files changed, 11 insertions, 3 deletions
@@ -54,7 +54,7 @@ Bug Fixes: - PR#5436: update object ids on unmarshaling - PR#5453: configure doesn't find X11 under Ubuntu/MultiarchSpec - emacs mode: colorization of comments and strings now works correctly - +- PR#5469: private record type generated by functor loses abbreviation Feature wishes: - PR#352: new option "-stdin" to make ocaml read stdin as a script - PR#5358: first class modules don't allow "with type" declarations for types diff --git a/testsuite/tests/typing-private-bugs/pr5469_ok.ml b/testsuite/tests/typing-private-bugs/pr5469_ok.ml new file mode 100644 index 000000000..74d355499 --- /dev/null +++ b/testsuite/tests/typing-private-bugs/pr5469_ok.ml @@ -0,0 +1,7 @@ +module M (T:sig type t end) + = struct type t = private { t : T.t } end +module P + = struct + module T = struct type t end + module R = M(T) + end diff --git a/typing/mtype.ml b/typing/mtype.ml index 404dda95b..57ed4e290 100644 --- a/typing/mtype.ml +++ b/typing/mtype.ml @@ -48,8 +48,9 @@ and strengthen_sig env sg p = sigelt :: strengthen_sig env rem p | Tsig_type(id, decl, rs) :: rem -> let newdecl = - match decl.type_manifest with - Some ty when decl.type_private = Public -> decl + match decl.type_manifest, decl.type_private, decl.type_kind with + Some _, Public, _ -> decl + | Some _, Private, (Type_record _ | Type_variant _) -> decl | _ -> let manif = Some(Btype.newgenty(Tconstr(Pdot(p, Ident.name id, nopos), |