Переглянути джерело

[matcher] bring back special null case

Simon Krajewski 2 роки тому
батько
коміт
54cdc1ad6b
1 змінених файлів з 2 додано та 1 видалено
  1. 2 1
      src/typing/matcher/texprConverter.ml

+ 2 - 1
src/typing/matcher/texprConverter.ml

@@ -78,7 +78,7 @@ let unify_constructor ctx params t con =
 		Some(con,params)
 
 let rec extract_ctor e = match e.eexpr with
-	| TConst ct when ct <> TNull -> Some (ConConst ct)
+	| TConst ct -> Some (ConConst ct)
 	| TField(_,FEnum(en,ef)) -> Some (ConEnum(en,ef))
 	| TCast(e1,None) -> extract_ctor e1
 	| _ -> None
@@ -131,6 +131,7 @@ let all_ctors ctx e cases =
 				if has_class_field_flag cf CfImpl && has_class_field_flag cf CfEnum then match cf.cf_expr with
 					| Some e ->
 						begin match extract_ctor e with
+						| Some (ConConst TNull) -> ()
 						| Some ctor -> add (ctor,null_pos)
 						| None -> add (ConStatic(c,cf),null_pos)
 						end;