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

removed type_expr_raise usage (too wide catching) : this is not perfect yet and unify_call_params might fail in some cases, but is a necessary tmp fix

Nicolas Cannasse 12 роки тому
батько
коміт
b68ddb6f66
2 змінених файлів з 1 додано та 13 видалено
  1. 0 12
      typecore.ml
  2. 1 1
      typer.ml

+ 0 - 12
typecore.ml

@@ -196,18 +196,6 @@ let error msg p = raise (Error (Custom msg,p))
 
 let type_expr ctx e with_type = (!type_expr_ref) ctx e with_type
 
-let type_expr_raise ctx e with_type =
-	let old = ctx.on_error in
-	ctx.on_error <- (fun _ msg p -> raise (Error (Unify [Unify_custom msg],p)));
-	try
-		let e = type_expr ctx e with_type in
-		ctx.on_error <- old;
-		e
-	with
-		Error _ as e ->
-			ctx.on_error <- old;
-			raise e
-
 let unify_min ctx el = (!unify_min_ref) ctx el
 
 let match_expr ctx e cases def with_type p = !match_expr_ref ctx e cases def with_type p

+ 1 - 1
typer.ml

@@ -436,7 +436,7 @@ let rec unify_call_params ctx cf el args r p inline =
 			| (name,ul) :: _ -> arg_error (Unify_custom ("Invalid arguments\n" ^ fun_details()) :: ul) name true p)
 		| ee :: l, (name,opt,t) :: l2 ->
 			try
-				let e = type_expr_raise ctx ee (WithType t) in
+				let e = type_expr ctx ee (WithType t) in
 				unify_raise ctx e.etype t e.epos;
 				loop ((e,false) :: acc) l l2 skip
 			with