Kaynağa Gözat

[gencommon] treat Null<TypeParam> like TypeParam

Simon Krajewski 2 yıl önce
ebeveyn
işleme
f9b537ae71
1 değiştirilmiş dosya ile 7 ekleme ve 1 silme
  1. 7 1
      src/codegen/gencommon/normalize.ml

+ 7 - 1
src/codegen/gencommon/normalize.ml

@@ -50,7 +50,13 @@ let rec filter_param (stack:t list) t =
 	| TAbstract({ a_path = (["haxe"],"Rest") } as a,tl) ->
 		TAbstract(a, List.map (filter_param stack) tl)
 	| TAbstract({a_path = [],"Null"} as a,[t]) ->
-		TAbstract(a,[filter_param stack t])
+		(* Null<TypeParameter> is the same as TypeParameter *)
+		begin match follow t with
+		| TInst({cl_kind = KTypeParameter _},_) ->
+			filter_param stack t
+		| _ ->
+			TAbstract(a,[filter_param stack t])
+		end
 	| TAbstract(a,tl) when (Meta.has Meta.MultiType a.a_meta) ->
 		filter_param stack (Abstract.get_underlying_type a tl)
 	| TAbstract(a,tl) ->