Преглед на файлове

infer abstract nullability from its underlying type for non-core-type abstracts

Simon Krajewski преди 12 години
родител
ревизия
16c98d4e7c
променени са 1 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 4 1
      type.ml

+ 4 - 1
type.ml

@@ -639,7 +639,10 @@ let rec is_nullable ?(no_lazy=false) = function
 
 	| TInst ({ cl_kind = KTypeParameter },_) -> false
 *)
-	| TAbstract (a,_) -> not (Meta.has Meta.NotNull a.a_meta)
+	| TAbstract (a,_) when Meta.has Meta.CoreType a.a_meta ->
+		not (Meta.has Meta.NotNull a.a_meta)
+	| TAbstract (a,tl) ->
+		is_nullable (apply_params a.a_types tl a.a_this)
 	| _ ->
 		true