Bläddra i källkod

fix monomorph/null type equality handling

Simon Krajewski 9 år sedan
förälder
incheckning
4ec228380b
2 ändrade filer med 9 tillägg och 4 borttagningar
  1. 8 3
      analyzer.ml
  2. 1 1
      type.ml

+ 8 - 3
analyzer.ml

@@ -1923,9 +1923,14 @@ module DataFlow (M : DataFlowApi) = struct
 		M.commit ctx
 end
 
-let type_iseq_strict_no_mono t1 t2 = match follow t1,follow t2 with
-	| TMono _,_ | _,TMono _ -> true
-	| _ -> type_iseq_strict t1 t2
+let type_iseq_strict_no_mono t1 t2 =
+	let rec map t = match follow t with
+		| TMono _ -> t_dynamic
+		| _ -> Type.map map t
+	in
+	let t1 = map t1 in
+	let t2 = map t2 in
+	type_iseq_strict t1 t2
 
 (*
 	ConstPropagation implements sparse conditional constant propagation using the DataFlow algorithm. Its lattice consists of

+ 1 - 1
type.ml

@@ -1442,7 +1442,7 @@ type eq_kind =
 let rec type_eq param a b =
 	let can_follow t = match param with
 		| EqCoreType -> false
-		| EqDoNotFollowNull -> not (is_null t)
+		| EqDoNotFollowNull -> not (is_explicit_null t)
 		| _ -> true
 	in
 	if a == b then