|
@@ -2375,7 +2375,7 @@ let make_macro_api ctx p =
|
|
let m, tdef, pos = (try Interp.decode_type_def v with Interp.Invalid_expr -> Interp.exc (Interp.VString "Invalid type definition")) in
|
|
let m, tdef, pos = (try Interp.decode_type_def v with Interp.Invalid_expr -> Interp.exc (Interp.VString "Invalid type definition")) in
|
|
let mdep = Typeload.type_module ctx m ctx.current.m_extra.m_file [tdef,pos] pos in
|
|
let mdep = Typeload.type_module ctx m ctx.current.m_extra.m_file [tdef,pos] pos in
|
|
mdep.m_extra.m_kind <- MFake;
|
|
mdep.m_extra.m_kind <- MFake;
|
|
- ctx.current.m_extra.m_deps <- PMap.add mdep () ctx.current.m_extra.m_deps;
|
|
|
|
|
|
+ add_dependency ctx.current mdep;
|
|
);
|
|
);
|
|
Interp.module_dependency = (fun mpath file ->
|
|
Interp.module_dependency = (fun mpath file ->
|
|
let m = typing_timer ctx (fun() -> Typeload.load_module ctx (parse_path mpath) p) in
|
|
let m = typing_timer ctx (fun() -> Typeload.load_module ctx (parse_path mpath) p) in
|
|
@@ -2397,7 +2397,7 @@ let make_macro_api ctx p =
|
|
Hashtbl.add fake_modules file mdep;
|
|
Hashtbl.add fake_modules file mdep;
|
|
mdep
|
|
mdep
|
|
) in
|
|
) in
|
|
- m.m_extra.m_deps <- PMap.add mdep () m.m_extra.m_deps;
|
|
|
|
|
|
+ add_dependency m mdep;
|
|
Hashtbl.replace ctx.g.modules mdep.m_path mdep
|
|
Hashtbl.replace ctx.g.modules mdep.m_path mdep
|
|
);
|
|
);
|
|
}
|
|
}
|
|
@@ -2453,7 +2453,7 @@ let load_macro ctx cpath f p =
|
|
let m = (try Hashtbl.find ctx.g.types_module cpath with Not_found -> cpath) in
|
|
let m = (try Hashtbl.find ctx.g.types_module cpath with Not_found -> cpath) in
|
|
let mloaded = Typeload.load_module ctx2 m p in
|
|
let mloaded = Typeload.load_module ctx2 m p in
|
|
ctx2.local_types <- mloaded.m_types;
|
|
ctx2.local_types <- mloaded.m_types;
|
|
- ctx.current.m_extra.m_deps <- PMap.add mloaded () ctx.current.m_extra.m_deps;
|
|
|
|
|
|
+ add_dependency ctx.current mloaded;
|
|
let meth = (match Typeload.load_instance ctx2 { tpackage = fst cpath; tname = snd cpath; tparams = []; tsub = None } p true with
|
|
let meth = (match Typeload.load_instance ctx2 { tpackage = fst cpath; tname = snd cpath; tparams = []; tsub = None } p true with
|
|
| TInst (c,_) -> (try PMap.find f c.cl_statics with Not_found -> error ("Method " ^ f ^ " not found on class " ^ s_type_path cpath) p)
|
|
| TInst (c,_) -> (try PMap.find f c.cl_statics with Not_found -> error ("Method " ^ f ^ " not found on class " ^ s_type_path cpath) p)
|
|
| _ -> error "Macro should be called on a class" p
|
|
| _ -> error "Macro should be called on a class" p
|