Browse Source

prevent unification of mono inlined expr (fixed issue #900)

Nicolas Cannasse 13 years ago
parent
commit
ecba80fc88
1 changed files with 2 additions and 0 deletions
  1. 2 0
      optimizer.ml

+ 2 - 0
optimizer.ml

@@ -332,6 +332,8 @@ let rec type_inline ctx cf f ethis params tret p force =
 		let wrap e =
 			(* we can't mute the type of the expression because it is not correct to do so *)
 			(try
+				(* if the expression is "untyped", we don't want to unify it accidentally ! *)
+				(match follow e.etype with TMono _ -> raise (Unify_error []) | _ -> ());
 				type_eq EqStrict (if has_params then map_type e.etype else e.etype) tret;
 				e
 			with Unify_error _ ->