Pārlūkot izejas kodu

pass field position to `unify_field_call` because it's different from the call position (see #3671)

Simon Krajewski 10 gadi atpakaļ
vecāks
revīzija
6f7c3b8ccc
1 mainītis faili ar 4 papildinājumiem un 4 dzēšanām
  1. 4 4
      typer.ml

+ 4 - 4
typer.ml

@@ -777,8 +777,8 @@ let unify_field_call ctx fa el args ret p inline =
 				begin match follow t with
 				begin match follow t with
 					| TFun(args,ret) ->
 					| TFun(args,ret) ->
 						let el,tf = unify_call_args' ctx el args ret p inline is_forced_inline in
 						let el,tf = unify_call_args' ctx el args ret p inline is_forced_inline in
-						let mk_call ethis =
-							let ef = mk (TField(ethis,mk_fa cf)) tf p in
+						let mk_call ethis p_field =
+							let ef = mk (TField(ethis,mk_fa cf)) tf p_field in
 							make_call ctx ef (List.map fst el) ret p
 							make_call ctx ef (List.map fst el) ret p
 						in
 						in
 						let candidate = (el,tf,mk_call) in
 						let candidate = (el,tf,mk_call) in
@@ -3834,7 +3834,7 @@ and build_call ctx acc el (with_type:with_type) p =
 		(match follow t with
 		(match follow t with
 			| TFun (args,r) ->
 			| TFun (args,r) ->
 				let _,_,mk_call = unify_field_call ctx fmode el args r p true in
 				let _,_,mk_call = unify_field_call ctx fmode el args r p true in
-				mk_call ethis
+				mk_call ethis p
 			| _ ->
 			| _ ->
 				error (s_type (print_context()) t ^ " cannot be called") p
 				error (s_type (print_context()) t ^ " cannot be called") p
 		)
 		)
@@ -3934,7 +3934,7 @@ and build_call ctx acc el (with_type:with_type) p =
 							type_generic_function ctx (e1,fa) el with_type p
 							type_generic_function ctx (e1,fa) el with_type p
 						| _ ->
 						| _ ->
 							let _,_,mk_call = unify_field_call ctx fa el args r p false in
 							let _,_,mk_call = unify_field_call ctx fa el args r p false in
-							mk_call e1
+							mk_call e1 e.epos
 					end
 					end
 				| _ ->
 				| _ ->
 					let el, tfunc = unify_call_args ctx el args r p false false in
 					let el, tfunc = unify_call_args ctx el args r p false false in