Browse Source

don't try implicit casts of rest arguments against an unbound monomorph (#10143)

Aleksandr Kuzmenko 4 years ago
parent
commit
56f600d6ee
2 changed files with 2 additions and 8 deletions
  1. 2 7
      src/typing/callUnification.ml
  2. 0 1
      tests/unit/src/unit/issues/Issue10143.hx

+ 2 - 7
src/typing/callUnification.ml

@@ -125,13 +125,8 @@ let rec unify_call_args ctx el args r callp inline force_inline in_overload =
 						| _ when ExtType.is_mono (follow arg_t) ->
 							(try
 								let el = type_rest mk_mono in
-								try
-									Type.unify (unify_min ctx el) arg_t;
-									el
-								with Unify_error _ ->
-									handle_errors (fun() ->
-										List.map (fun e -> !cast_or_unify_raise_ref ctx arg_t e e.epos) el
-									)
+								unify ctx (unify_min ctx el) arg_t (punion_el (List.map (fun e -> ((),e.epos)) el));
+								el
 							with WithTypeError(ul,p) ->
 								arg_error ul name false p)
 						| _ ->

+ 0 - 1
tests/unit/src/unit/issues/Issue10143.hx

@@ -9,7 +9,6 @@ class Issue10143 extends Test {
 		eq('String', HelperMacros.typeString(Win.test('hello')));
 		eq('Bool', HelperMacros.typeString(Win.test({field:'world'})));
 		eq('String', HelperMacros.typeString(Win.test(('hello':AString))));
-		eq('Bool', HelperMacros.typeString(Win.test(({field:'world'}:AObj))));
 	}
 }