@@ -199,10 +199,14 @@ let rec list_continuation final f l _ = match l with [] -> final ()
199
199
let rec translate_module_command ~opaque_access ?name arity r =
200
200
check_nothing_ongoing () ;
201
201
let qid = r in
202
- let mb = try Global. lookup_module (Nametab. locate_module qid)
202
+ let mp, mb =
203
+ try
204
+ let mp = Nametab. locate_module qid in
205
+ let mb = Global. lookup_module mp in
206
+ mp, mb
203
207
with Not_found -> error Pp. (str " Unknown Module " ++ pr_qualid qid)
204
208
in
205
- declare_module ~opaque_access ?name arity mb
209
+ declare_module ~opaque_access ?name arity mp mb
206
210
207
211
and id_of_module_path mp =
208
212
let open Names in
@@ -212,10 +216,9 @@ and id_of_module_path mp =
212
216
| MPfile dp -> List. hd (DirPath. repr dp)
213
217
| MPbound id -> MBId. to_id id
214
218
215
- and declare_module ~opaque_access ?(continuation = ignore) ?name arity mb =
219
+ and declare_module ~opaque_access ?(continuation = ignore) ?name arity mp mb =
216
220
debug_string [`Module ] " --> declare_module" ;
217
221
let open Declarations in
218
- let mp = Mod_declarations. mod_mp mb in
219
222
match Mod_declarations. mod_expr mb, Mod_declarations. mod_type mb with
220
223
| Algebraic _, NoFunctor fields
221
224
| FullStruct , NoFunctor fields ->
@@ -302,7 +305,7 @@ and declare_module ~opaque_access ?(continuation = ignore) ?name arity mb =
302
305
(match Mod_declarations. mod_expr mb' with FullStruct | Algebraic _ -> true | _ -> false )
303
306
| _ -> false
304
307
->
305
- declare_module ~opaque_access ~continuation arity mb'
308
+ declare_module ~opaque_access ~continuation arity ( MPdot (mp, lab)) mb'
306
309
307
310
| (lab , _ ) ->
308
311
Pp. (Flags. if_verbose msg_info (str (Printf. sprintf " Ignoring field '%s'." (Names.Label. to_string lab))));
0 commit comments