summaryrefslogtreecommitdiff
path: root/typing/printtyp.ml
diff options
context:
space:
mode:
authorLeo White <leo@lpw25.net>2021-11-18 13:16:13 +0000
committerLeo White <leo@lpw25.net>2021-11-18 13:16:13 +0000
commit05d49af22e479d0bca3c26dfc9e49d6031899e06 (patch)
tree880639f00476c2e6360746bbb27189f9bf21d5a1 /typing/printtyp.ml
parentaa82df470da10c0431fd0a705bb5be0bceb31258 (diff)
downloadocaml-05d49af22e479d0bca3c26dfc9e49d6031899e06.tar.gz
Update privacy when methods are overridden. Fixes #10781.
Diffstat (limited to 'typing/printtyp.ml')
-rw-r--r--typing/printtyp.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/typing/printtyp.ml b/typing/printtyp.ml
index e55437587e..1a69644988 100644
--- a/typing/printtyp.ml
+++ b/typing/printtyp.ml
@@ -1573,7 +1573,7 @@ let value_description id ppf decl =
let method_type priv ty =
match priv, get_desc ty with
- | Public, Tpoly(ty, tyl) -> (ty, tyl)
+ | Mpublic, Tpoly(ty, tyl) -> (ty, tyl)
| _ , _ -> (ty, [])
let prepare_method _lab (priv, _virt, ty) =
@@ -1584,7 +1584,7 @@ let tree_of_method mode (lab, priv, virt, ty) =
let (ty, tyl) = method_type priv ty in
let tty = tree_of_typexp mode ty in
Names.remove_names (List.map Transient_expr.repr tyl);
- let priv = priv = Private in
+ let priv = priv <> Mpublic in
let virt = virt = Virtual in
Ocsg_method (lab, priv, virt, tty)