Skip to content

Selecting overloaded methods with unsigned integer argument fails #283

Description

@makalu79

When trying to invoke a .NET method with a unsigned integer argument, it fails with "No method matches given arguments", if there is another method signature with the same name. To reproduce, use the class:

public class Class1
    {
      public string MethodWithOverloading(UInt16 aParam1)
      {
        return string.Format("MethodWithOverloading(int {0})", aParam1);
      }

      public string MethodWithOverloading(string aParam2)
      {
        return string.Format("MethodWithOverloading(string {0})", aParam2);
      }

      public string MethodWithOverloading(UInt16 aParam1, string aParam2)
      {
        return string.Format("MethodWithOverloading(int {0}, string {1})", aParam1, aParam2);
      }
    }

Then called from python with:

c = Class1()
print c.MethodWithOverloading('test')
print c.MethodWithOverloading(42)
print c.MethodWithOverloading(42, 'test')

line 2 works fine, but lines 3 and 4 fail with TypeError: No method matches given arguments (using 2.1.0)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions