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

remove unused value in Monomorph.close

Simon Krajewski преди 5 години
родител
ревизия
a749619547
променени са 4 файла, в които са добавени 8 реда и са изтрити 9 реда
  1. 1 2
      src/context/typecore.ml
  2. 5 5
      src/core/tUnification.ml
  3. 1 1
      src/typing/calls.ml
  4. 1 1
      src/typing/typeloadFunction.ml

+ 1 - 2
src/context/typecore.ml

@@ -553,8 +553,7 @@ let safe_mono_close ctx m p =
 		Monomorph.close m
 		Monomorph.close m
 	with
 	with
 		Unify_error l ->
 		Unify_error l ->
-			raise_or_display ctx l p;
-			false
+			raise_or_display ctx l p
 
 
 (* -------------- debug functions to activate when debugging typer passes ------------------------------- *)
 (* -------------- debug functions to activate when debugging typer passes ------------------------------- *)
 (*/*
 (*/*

+ 5 - 5
src/core/tUnification.ml

@@ -144,15 +144,15 @@ module Monomorph = struct
 
 
 	and close m = match m.tm_type with
 	and close m = match m.tm_type with
 		| Some _ ->
 		| Some _ ->
-			false
+			()
 		| None -> match classify_constraints m with
 		| None -> match classify_constraints m with
 			| CUnknown ->
 			| CUnknown ->
-				false
+				()
 			| CTypes [(t,_)] ->
 			| CTypes [(t,_)] ->
 				do_bind m t;
 				do_bind m t;
-				true
+				()
 			| CTypes _ ->
 			| CTypes _ ->
-				false
+				()
 			| CStructural(fields,_) ->
 			| CStructural(fields,_) ->
 				let check_recursion cf =
 				let check_recursion cf =
 					let rec loop t = match t with
 					let rec loop t = match t with
@@ -168,7 +168,7 @@ module Monomorph = struct
 				(* We found a bunch of fields but no type, create a merged structure type and bind to that *)
 				(* We found a bunch of fields but no type, create a merged structure type and bind to that *)
 				PMap.iter (fun _ cf -> check_recursion cf) fields;
 				PMap.iter (fun _ cf -> check_recursion cf) fields;
 				do_bind m (mk_anon ~fields (ref Closed));
 				do_bind m (mk_anon ~fields (ref Closed));
-				true
+				()
 
 
 	let unbind m =
 	let unbind m =
 		m.tm_type <- None
 		m.tm_type <- None

+ 1 - 1
src/typing/calls.ml

@@ -376,7 +376,7 @@ let type_generic_function ctx (e,fa) el ?(using_param=None) with_type p =
 	end;
 	end;
 	let el,_ = unify_call_args ctx el args ret p false false in
 	let el,_ = unify_call_args ctx el args ret p false false in
 	List.iter (fun t -> match follow t with
 	List.iter (fun t -> match follow t with
-		| TMono m -> ignore(safe_mono_close ctx m p)
+		| TMono m -> safe_mono_close ctx m p
 		| _ -> ()
 		| _ -> ()
 	) monos;
 	) monos;
 	let el = match using_param with None -> el | Some e -> e :: el in
 	let el = match using_param with None -> el | Some e -> e :: el in

+ 1 - 1
src/typing/typeloadFunction.ml

@@ -224,7 +224,7 @@ let type_function ctx args ret fmode f do_display p =
 		| _ -> e
 		| _ -> e
 	in
 	in
 	List.iter (fun r -> r := Closed) ctx.opened;
 	List.iter (fun r -> r := Closed) ctx.opened;
-	List.iter (fun (m,p) -> ignore(safe_mono_close ctx m p)) ctx.monomorphs.perfunction;
+	List.iter (fun (m,p) -> safe_mono_close ctx m p) ctx.monomorphs.perfunction;
 	if is_position_debug then print_endline ("typing:\n" ^ (Texpr.dump_with_pos "" e));
 	if is_position_debug then print_endline ("typing:\n" ^ (Texpr.dump_with_pos "" e));
 	e , fargs
 	e , fargs