|
@@ -278,8 +278,9 @@ let traverse gen ?tparam_anon_decl ?tparam_anon_acc (handle_anon_func:texpr->tfu
|
|
|
|
|
|
let rec get_type_params acc t =
|
|
|
match t with
|
|
|
- | TInst(( { cl_kind = KTypeParameter _ } as cl), []) ->
|
|
|
- if List.memq cl acc then acc else cl :: acc
|
|
|
+ | TInst(( { cl_kind = KTypeParameter constraints } as cl), []) ->
|
|
|
+ let params = List.fold_left get_type_params acc constraints in
|
|
|
+ List.filter (fun t -> not (List.memq t acc)) (cl :: params) @ acc;
|
|
|
| TFun (params,tret) ->
|
|
|
List.fold_left get_type_params acc ( tret :: List.map (fun (_,_,t) -> t) params )
|
|
|
| TDynamic t ->
|
|
@@ -413,6 +414,10 @@ let configure gen ft =
|
|
|
let cls = mk_class (get gen.gcurrent_class).cl_module path tfunc.tf_expr.epos in
|
|
|
if in_unsafe then cls.cl_meta <- (Meta.Unsafe,[],null_pos) :: cls.cl_meta;
|
|
|
|
|
|
+ (* forward NativeGen meta for Cs target *)
|
|
|
+ if (Common.platform gen.gcon Cs) && not(is_hxgen (TClassDecl (get gen.gcurrent_class))) && Meta.has(Meta.NativeGen) (get gen.gcurrent_class).cl_meta then
|
|
|
+ cls.cl_meta <- (Meta.NativeGen,[],null_pos) :: cls.cl_meta;
|
|
|
+
|
|
|
if Common.defined gen.gcon Define.EraseGenerics then begin
|
|
|
cls.cl_meta <- (Meta.HaxeGeneric,[],null_pos) :: cls.cl_meta
|
|
|
end;
|