@@ -433,9 +433,7 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, MethodBase info, Meth
433433 pi = pi . Take ( 1 ) . ToArray ( ) ;
434434 }
435435 int outs ;
436- var margs = TryConvertArguments ( pi , paramsArray , args , pynargs , kwargDict , defaultArgList ,
437- needsResolution : _methods . Length > 1 , // If there's more than one possible match.
438- outs : out outs ) ;
436+ var margs = TryConvertArguments ( pi , paramsArray , args , pynargs , kwargDict , defaultArgList , outs : out outs ) ;
439437 if ( margs == null )
440438 {
441439 var mismatchCause = PythonException . FetchCurrent ( ) ;
@@ -612,7 +610,6 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
612610 IntPtr args , int pyArgCount ,
613611 Dictionary < string , IntPtr > kwargDict ,
614612 ArrayList defaultArgList ,
615- bool needsResolution ,
616613 out int outs )
617614 {
618615 outs = 0 ;
@@ -653,7 +650,7 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
653650 }
654651
655652 bool isOut ;
656- if ( ! TryConvertArgument ( op , parameter . ParameterType , needsResolution , out margs [ paramIndex ] , out isOut ) )
653+ if ( ! TryConvertArgument ( op , parameter . ParameterType , out margs [ paramIndex ] , out isOut ) )
657654 {
658655 return null ;
659656 }
@@ -681,16 +678,15 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
681678 /// </summary>
682679 /// <param name="op">Pointer to the Python argument object.</param>
683680 /// <param name="parameterType">That parameter's managed type.</param>
684- /// <param name="needsResolution">If true, there are multiple overloading methods that need resolution.</param>
685681 /// <param name="arg">Converted argument.</param>
686682 /// <param name="isOut">Whether the CLR type is passed by reference.</param>
687683 /// <returns>true on success</returns>
688- static bool TryConvertArgument ( IntPtr op , Type parameterType , bool needsResolution ,
684+ static bool TryConvertArgument ( IntPtr op , Type parameterType ,
689685 out object arg , out bool isOut )
690686 {
691687 arg = null ;
692688 isOut = false ;
693- var clrtype = TryComputeClrArgumentType ( parameterType , op , needsResolution : needsResolution ) ;
689+ var clrtype = TryComputeClrArgumentType ( parameterType , op ) ;
694690 if ( clrtype == null )
695691 {
696692 return false ;
@@ -710,25 +706,14 @@ static bool TryConvertArgument(IntPtr op, Type parameterType, bool needsResoluti
710706 /// </summary>
711707 /// <param name="parameterType">The parameter's managed type.</param>
712708 /// <param name="argument">Pointer to the Python argument object.</param>
713- /// <param name="needsResolution">If true, there are multiple overloading methods that need resolution.</param>
714709 /// <returns>null if conversion is not possible</returns>
715- static Type TryComputeClrArgumentType ( Type parameterType , IntPtr argument , bool needsResolution )
710+ static Type TryComputeClrArgumentType ( Type parameterType , IntPtr argument )
716711 {
717712 // this logic below handles cases when multiple overloading methods
718713 // are ambiguous, hence comparison between Python and CLR types
719714 // is necessary
720715 Type clrtype = null ;
721716 IntPtr pyoptype ;
722- if ( needsResolution )
723- {
724- // HACK: each overload should be weighted in some way instead
725- pyoptype = Runtime . PyObject_Type ( argument ) ;
726- if ( pyoptype != IntPtr . Zero )
727- {
728- clrtype = Converter . GetTypeByAlias ( pyoptype ) ;
729- }
730- Runtime . XDecref ( pyoptype ) ;
731- }
732717
733718 if ( clrtype != null )
734719 {
0 commit comments