Commits

camlspotter  committed dc10c49

open*M overloads ids only in two levels of modules now: in M.x and M.N.x but not M.N.O.x

  • Participants
  • Parent commits fd92f59
  • Branches custom

Comments (0)

Files changed (2)

File boot/ocamlc

Binary file modified.

File typing/env.ml

   { newenv with summary = Env_open(env.summary, root) }
 
 let mtype_scrape = ref (fun _ -> assert false)
-let rec open_signature_overload ?(first_level=true) loc orig_root root sg env =
+let rec open_signature_overload ?(level=0) loc orig_root root sg env =
+
+  let first_level = level = 0 in
+
   (* Format.eprintf "%a %s@." format_longident lid (Path.unique_name p); *)
   (* jfuruse Format.eprintf "open %s@." (Path.unique_name root); *)
   add_opened_module loc root; (* No warning for recursive open *)
     List.fold_left2
       (fun env item p ->
         match item with
-          Tsig_value(id, decl) ->
+          Tsig_value(id, decl) when level <= 1 ->
             let e1 = store_value ~opened:orig_root (Ident.hide id) p
                         ~overloaded:true 
                         (Subst.value_description sub decl) env
             let root' = p in
             begin match !mtype_scrape env mty with
               | Tmty_signature sg' -> 
-                  let env' = if first_level then store_module ~opened:orig_root (Ident.hide id) p (Subst.modtype sub mty) env else env in
-                  open_signature_overload ~first_level:false Location.none orig_root root' sg' env'
+                  if first_level then 
+                    let env = store_module ~opened:orig_root (Ident.hide id) p (Subst.modtype sub mty) env in
+                    open_signature_overload ~level:(level+1) Location.none orig_root root' sg' env
+                  else env
               | _ -> 
                   if first_level then 
                     store_module ~opened:orig_root (Ident.hide id) p (Subst.modtype sub mty) env
       env sg pl in
   { newenv with summary = Env_open(env.summary, root) }
 
-let open_signature_overload loc root = open_signature_overload ~first_level:true loc root root
+let open_signature_overload loc root = open_signature_overload ~level:0 loc root root
 
 (* Open a signature from a file *)