2
0
Simon Krajewski 5 жил өмнө
parent
commit
74ffd950aa

+ 0 - 10
src/context/typecore.ml

@@ -139,7 +139,6 @@ and typer = {
 }
 
 and monomorphs = {
-	mutable percall : (tmono * pos) list;
 	mutable perfunction : (tmono * pos) list;
 }
 
@@ -543,7 +542,6 @@ let check_constraints map params tl p =
 let spawn_constrained_monos ctx p map params =
 	let monos = List.map (fun (s,_) ->
 		let mono = Monomorph.create() in
-		ctx.monomorphs.percall <- (mono,p) :: ctx.monomorphs.percall;
 		TMono mono
 	) params in
 	let map t = map (apply_params params monos t) in
@@ -558,14 +556,6 @@ let safe_mono_close ctx m p =
 			raise_or_display ctx l p;
 			false
 
-let with_contextual_monos ctx f =
-	let old_monos = ctx.monomorphs.percall in
-	ctx.monomorphs.percall <- [];
-	let r = f() in
-	(* List.iter (fun (m,p) -> ignore(safe_mono_close ctx m p)) ctx.monomorphs.percall; *)
-	ctx.monomorphs.percall <- old_monos;
-	r
-
 (* -------------- debug functions to activate when debugging typer passes ------------------------------- *)
 (*/*
 

+ 1 - 3
src/typing/calls.ml

@@ -388,9 +388,7 @@ let type_generic_function ctx (e,fa) el ?(using_param=None) with_type p =
 		| WithType.WithType(t,_) -> unify ctx ret t p
 		| _ -> ()
 	end;
-	let el,_ = with_contextual_monos ctx (fun () ->
-		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
 		| TMono m -> ignore(safe_mono_close ctx m p)
 		| _ -> ()

+ 0 - 1
src/typing/typeloadModule.ml

@@ -972,7 +972,6 @@ let type_types_into_module ctx m tdecls p =
 		opened = [];
 		in_call_args = false;
 		monomorphs = {
-			percall = [];
 			perfunction = [];
 		};
 		vthis = None;

+ 2 - 5
src/typing/typer.ml

@@ -2397,10 +2397,8 @@ and type_call_target ctx e with_type inline p =
 
 and type_call ?(mode=MGet) ctx e el (with_type:WithType.t) inline p =
 	let def () =
-		with_contextual_monos ctx (fun () ->
-			let e = type_call_target ctx e with_type inline p in
-			build_call ~mode ctx e el with_type p;
-		)
+		let e = type_call_target ctx e with_type inline p in
+		build_call ~mode ctx e el with_type p;
 	in
 	match e, el with
 	| (EConst (Ident "trace"),p) , e :: el ->
@@ -2692,7 +2690,6 @@ let rec create com =
 		vthis = None;
 		in_call_args = false;
 		monomorphs = {
-			percall = [];
 			perfunction = [];
 		};
 		on_error = (fun ctx msg p -> ctx.com.error msg p);