summaryrefslogtreecommitdiff
path: root/typing/printtyp.ml
diff options
context:
space:
mode:
authorFlorian Angeletti <florian.angeletti@inria.fr>2022-10-20 13:57:27 +0200
committerFlorian Angeletti <florian.angeletti@inria.fr>2023-01-02 15:39:24 +0100
commit10275ce2de27a8999609d8b965cb83499fe4193a (patch)
tree774510dafcb0f837921272e464ccc34f69b936c3 /typing/printtyp.ml
parentdfe8a01534edcd7beac3cce879ba89a6b017d98f (diff)
downloadocaml-10275ce2de27a8999609d8b965cb83499fe4193a.tar.gz
review: printtyp, document collect_explanations
Diffstat (limited to 'typing/printtyp.ml')
-rw-r--r--typing/printtyp.ml6
1 files changed, 6 insertions, 0 deletions
diff --git a/typing/printtyp.ml b/typing/printtyp.ml
index 7f1fd5297e..c1ab6817a3 100644
--- a/typing/printtyp.ml
+++ b/typing/printtyp.ml
@@ -144,10 +144,16 @@ module Conflicts = struct
let collect_explanation namespace id ~name =
let root_name = Ident.name id in
+ (* if [name] is of the form "root_name/%d", we register both
+ [id] and the identifier in scope for [root_name].
+ *)
if root_name <> name && not (M.mem name !explanations) then
begin
add namespace name id;
if not (M.mem root_name !explanations) then
+ (* lookup the identifier in scope with name [root_name] and
+ add it too
+ *)
match Namespace.lookup namespace root_name with
| Pident root_id -> add namespace root_name root_id
| exception Not_found | _ -> ()