Browse Source

reduce diff

Simon Krajewski 5 years ago
parent
commit
ac67476f80

+ 0 - 1
src/context/typecore.ml

@@ -543,7 +543,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
-		(* 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

+ 1 - 10
src/core/tPrinting.ml

@@ -108,20 +108,11 @@ and s_type_params ctx = function
 	| [] -> ""
 	| l -> "<" ^ String.concat ", " (List.map (s_type ctx) l) ^ ">"
 
-and extract_mono_name m =
-	let rec loop l = match l with
-		| [] -> "?"
-		| {mc_kind = MDebug s} :: _ -> s
-		| _ :: l -> loop l
-	in
-	loop m.tm_constraints
-
 and s_constraint = function
-	| MMono m -> Printf.sprintf "MMono %s" (extract_mono_name m)
+	| MMono m -> Printf.sprintf "MMono %s" (s_type_kind (TMono m))
 	| MField cf -> Printf.sprintf "MField %s" cf.cf_name
 	| MType t -> Printf.sprintf "MType %s" (s_type_kind t)
 	| MOpenStructure -> "MOpenStructure"
-	| MDebug _ -> "MDebug"
 
 let s_access is_read = function
 	| AccNormal -> "default"

+ 0 - 1
src/core/tType.ml

@@ -53,7 +53,6 @@ and tmono_constraint_kind =
 	| MField of tclass_field
 	| MType of t
 	| MOpenStructure
-	| MDebug of string
 
 and tmono_constraint = {
 	mc_kind : tmono_constraint_kind;

+ 0 - 2
src/core/tUnification.ml

@@ -104,8 +104,6 @@ module Monomorph = struct
 				DynArray.add types (constr.mc_name,constr.mc_pos,t2)
 			| MOpenStructure ->
 				is_open := true
-			| MDebug name ->
-				()
 		in
 		List.iter check m.tm_constraints;
 		if DynArray.length types > 0 then

+ 0 - 1
src/typing/fields.ml

@@ -516,7 +516,6 @@ let rec type_field cfg ctx e i p mode =
 		| CUnknown ->
 			if not (List.exists (fun (m,_) -> m == r) ctx.monomorphs.perfunction) && not (ctx.untyped && ctx.com.platform = Neko) then begin
 				ctx.monomorphs.perfunction <- (r,p) :: ctx.monomorphs.perfunction;
-				(* if Meta.has (Meta.Custom ":debug.monomorphs") ctx.curfield.cf_meta then Monomorph.add_constraint r "debug" p (MDebug "FA"); *)
 			end;
 			let f = mk_field() in
 			Monomorph.add_constraint r "FA" p (MField f);

+ 2 - 0
tests/unit/src/unit/issues/Issue6379.hx

@@ -1,6 +1,7 @@
 package unit.issues;
 
 class Issue6379 extends unit.Test {
+	#if (!java && !lua)
 	function test() {
         eq(g("x_x").length, 2);
     }
@@ -10,4 +11,5 @@ class Issue6379 extends unit.Test {
 		g.bind("");
         return r;
 	}
+	#end
 }