|
@@ -590,6 +590,12 @@ let load_core_type ctx name =
|
|
let show = hide_types ctx in
|
|
let show = hide_types ctx in
|
|
let t = load_instance ctx { tpackage = []; tname = name; tparams = []; tsub = None; } null_pos false in
|
|
let t = load_instance ctx { tpackage = []; tname = name; tparams = []; tsub = None; } null_pos false in
|
|
show();
|
|
show();
|
|
|
|
+ add_dependency ctx.m.curmod (match t with
|
|
|
|
+ | TInst (c,_) -> c.cl_module
|
|
|
|
+ | TType (t,_) -> t.t_module
|
|
|
|
+ | TAbstract (a,_) -> a.a_module
|
|
|
|
+ | TEnum (e,_) -> e.e_module
|
|
|
|
+ | _ -> assert false);
|
|
t
|
|
t
|
|
|
|
|
|
let t_iterator ctx =
|
|
let t_iterator ctx =
|
|
@@ -597,6 +603,7 @@ let t_iterator ctx =
|
|
match load_type_def ctx null_pos { tpackage = []; tname = "Iterator"; tparams = []; tsub = None } with
|
|
match load_type_def ctx null_pos { tpackage = []; tname = "Iterator"; tparams = []; tsub = None } with
|
|
| TTypeDecl t ->
|
|
| TTypeDecl t ->
|
|
show();
|
|
show();
|
|
|
|
+ add_dependency ctx.m.curmod t.t_module;
|
|
if List.length t.t_types <> 1 then assert false;
|
|
if List.length t.t_types <> 1 then assert false;
|
|
let pt = mk_mono() in
|
|
let pt = mk_mono() in
|
|
apply_params t.t_types [pt] t.t_type, pt
|
|
apply_params t.t_types [pt] t.t_type, pt
|
|
@@ -2338,7 +2345,7 @@ let type_module ctx m file tdecls p =
|
|
if ctx.g.std != null_module then begin
|
|
if ctx.g.std != null_module then begin
|
|
add_dependency m ctx.g.std;
|
|
add_dependency m ctx.g.std;
|
|
(* this will ensure both String and (indirectly) Array which are basic types which might be referenced *)
|
|
(* this will ensure both String and (indirectly) Array which are basic types which might be referenced *)
|
|
- add_dependency m (match follow (load_core_type ctx "String") with TInst (c,_) -> c.cl_module | _ -> assert false);
|
|
|
|
|
|
+ ignore(load_core_type ctx "String");
|
|
end;
|
|
end;
|
|
(* define the per-module context for the next pass *)
|
|
(* define the per-module context for the next pass *)
|
|
let ctx = {
|
|
let ctx = {
|