浏览代码

Revert "check constraints of spawned monomorphs after typing a call (fixes #10198)"

This reverts commit cb7d3f5f9e12c960bfb28cfa321a14b215ffbfce.
Aleksandr Kuzmenko 4 年之前
父节点
当前提交
8393b25ed2

+ 0 - 13
src/typing/callUnification.ml

@@ -300,19 +300,6 @@ let unify_field_call ctx fa el_typed el p inline =
 				let ef = mk (TField(fa.fa_on,FieldAccess.apply_fa cf fa.fa_host)) t fa.fa_pos in
 				!make_call_ref ctx ef el ret ~force_inline:inline p
 			in
-			delay ctx PCheckConstraint (fun() ->
-				List.iter (fun t ->
-					match t with
-					| TMono m ->
-						let kind = Monomorph.classify_constraints m in
-						(try
-							Monomorph.check_constraints kind t
-						with Unify_error el ->
-							List.iter (fun e -> display_error ctx (unify_error_msg (print_context()) e) p) el
-						)
-					| _ -> ()
-				) monos
-			);
 			make_field_call_candidate el ret monos tf cf (mk_call,extract_delayed_display())
 		| t ->
 			error (s_type (print_context()) t ^ " cannot be called") p

+ 0 - 7
tests/misc/projects/Issue10198/Main.hx

@@ -1,7 +0,0 @@
-class Main {
-	static function main()
-		var b:Int = fn(fn('s'));
-
-	static public function fn<T, R:T>(v:R):T
-		return null;
-}

+ 0 - 1
tests/misc/projects/Issue10198/compile-fail.hxml

@@ -1 +0,0 @@
---main Main

+ 0 - 2
tests/misc/projects/Issue10198/compile-fail.hxml.stderr

@@ -1,2 +0,0 @@
-Main.hx:3: characters 18-25 : Constraint check failure for fn.R
-Main.hx:3: characters 18-25 : Int should be String