Browse Source

[typer] cleanup

Simon Krajewski 5 years ago
parent
commit
1cc47520a4
4 changed files with 3 additions and 19 deletions
  1. 0 10
      src/context/typecore.ml
  2. 1 3
      src/typing/calls.ml
  3. 0 1
      src/typing/typeloadModule.ml
  4. 2 5
      src/typing/typer.ml

+ 0 - 10
src/context/typecore.ml

@@ -139,7 +139,6 @@ and typer = {
 }
 
 and monomorphs = {
-	mutable percall : (tmono * pos) list;
 	mutable perfunction : (tmono * pos) list;
 }
 
@@ -523,19 +522,10 @@ let merge_core_doc ctx mt =
 let spawn_constrained_monos ctx p map params =
 	let monos = List.map (fun (s,_) ->
 		let mono = Monomorph.create() in
-		(* if Meta.has (Meta.Custom ":debug.monomorphs") ctx.curfield.cf_meta then Monomorph.add_constraint mono "debug" p (MDebug s); *)
-		ctx.monomorphs.percall <- (mono,p) :: ctx.monomorphs.percall;
 		TMono mono
 	) params in
 	monos
 
-let with_contextual_monos ctx f =
-	let old_monos = ctx.monomorphs.percall in
-	ctx.monomorphs.percall <- [];
-	let r = f() in
-	ctx.monomorphs.percall <- old_monos;
-	r
-
 (* -------------- debug functions to activate when debugging typer passes ------------------------------- *)
 (*/*
 

+ 1 - 3
src/typing/calls.ml

@@ -374,9 +374,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
 	begin try
 		check_constraints ctx cf.cf_name cf.cf_params monos map false p
 	with Unify_error l ->

+ 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

@@ -2403,10 +2403,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 ->
@@ -2698,7 +2696,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);