|
@@ -115,6 +115,15 @@ let create_static_ctor com ~empty_ctor_expr cl ctor follow_type =
|
|
|
let static_ctor_name = make_static_ctor_name cl in
|
|
|
(* create the static constructor *)
|
|
|
let ctor_types = List.map (fun (s,t) -> (s, TInst(map_param (get_cl_t t), []))) cl.cl_params in
|
|
|
+ let ctor_type_params = List.map snd ctor_types in
|
|
|
+ List.iter (function (_,TInst(c,[])) -> (
|
|
|
+ match c.cl_kind with
|
|
|
+ | KTypeParameter (hd :: tail) ->
|
|
|
+ let before = hd :: tail in
|
|
|
+ let after = List.map (apply_params cl.cl_params ctor_type_params) (before) in
|
|
|
+ c.cl_kind <- KTypeParameter(after)
|
|
|
+ | _ -> ())
|
|
|
+ | _ -> ()) ctor_types;
|
|
|
let me = alloc_var "__hx_this" (TInst(cl, List.map snd ctor_types)) in
|
|
|
me.v_capture <- true;
|
|
|
|