|
@@ -824,6 +824,15 @@ let init_class ctx c p herits fields =
|
|
if not c.cl_extern then ignore(define_constructor ctx c);
|
|
if not c.cl_extern then ignore(define_constructor ctx c);
|
|
fl
|
|
fl
|
|
|
|
|
|
|
|
+let resolve_typedef ctx t =
|
|
|
|
+ match t with
|
|
|
|
+ | TClassDecl _ | TEnumDecl _ -> t
|
|
|
|
+ | TTypeDecl td ->
|
|
|
|
+ match follow td.t_type with
|
|
|
|
+ | TEnum (e,_) -> TEnumDecl e
|
|
|
|
+ | TInst (c,_) -> TClassDecl c
|
|
|
|
+ | _ -> t
|
|
|
|
+
|
|
let type_module ctx m tdecls loadp =
|
|
let type_module ctx m tdecls loadp =
|
|
(* PASS 1 : build module structure - does not load any module or type - should be atomic ! *)
|
|
(* PASS 1 : build module structure - does not load any module or type - should be atomic ! *)
|
|
let decls = ref [] in
|
|
let decls = ref [] in
|
|
@@ -960,10 +969,10 @@ let type_module ctx m tdecls loadp =
|
|
| None ->
|
|
| None ->
|
|
let md = ctx.api.load_module (t.tpackage,t.tname) p in
|
|
let md = ctx.api.load_module (t.tpackage,t.tname) p in
|
|
let types = List.filter (fun t -> not (t_private t)) md.mtypes in
|
|
let types = List.filter (fun t -> not (t_private t)) md.mtypes in
|
|
- ctx.local_using <- ctx.local_using @ types;
|
|
|
|
|
|
+ ctx.local_using <- ctx.local_using @ (List.map (resolve_typedef ctx) types);
|
|
| Some _ ->
|
|
| Some _ ->
|
|
let t = load_type_def ctx p t in
|
|
let t = load_type_def ctx p t in
|
|
- ctx.local_using<- ctx.local_using @ [t])
|
|
|
|
|
|
+ ctx.local_using<- ctx.local_using @ [resolve_typedef ctx t])
|
|
| EClass d ->
|
|
| EClass d ->
|
|
let c = get_class d.d_name in
|
|
let c = get_class d.d_name in
|
|
delays := !delays @ check_overriding ctx c p :: check_interfaces ctx c p :: init_class ctx c p d.d_flags d.d_data
|
|
delays := !delays @ check_overriding ctx c p :: check_interfaces ctx c p :: init_class ctx c p d.d_flags d.d_data
|