Method overload object type by vmuriart · Pull Request #377 · pythonnet/pythonnet · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/runtime/methodbinder.cs
65 changes: 65 additions & 0 deletions src/testing/methodtest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,71 @@ public static int[] TestOverloadedParams(int v, int[] args)
return args;
}

public static string TestOverloadedNoObject(int i)
{
return "Got int";
}

public static string TestOverloadedObject(int i)
{
return "Got int";
}

public static string TestOverloadedObject(object o)
{
return "Got object";
}

public static string TestOverloadedObjectTwo(int a, int b)
{
return "Got int-int";
}

public static string TestOverloadedObjectTwo(string a, string b)
{
return "Got string-string";
}

public static string TestOverloadedObjectTwo(string a, int b)
{
return "Got string-int";
}

public static string TestOverloadedObjectTwo(string a, object b)
{
return "Got string-object";
}

public static string TestOverloadedObjectTwo(int a, object b)
{
return "Got int-object";
}

public static string TestOverloadedObjectTwo(object a, int b)
{
return "Got object-int";
}

public static string TestOverloadedObjectTwo(object a, object b)

@den-run-ai den-run-ai Feb 21, 2017

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't test this method in python

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because you changed the test for it above. I re-added a test for it.

{
return "Got object-object";
}

public static string TestOverloadedObjectTwo(int a, string b)
{
return "Got int-string";
}

public static string TestOverloadedObjectThree(object a, int b)
{
return "Got object-int";
}

public static string TestOverloadedObjectThree(int a, object b)
{
return "Got int-object";
}

public static bool TestStringOutParams(string s, out string s1)
{
s1 = "output string";
Expand Down
50 changes: 50 additions & 0 deletions src/tests/test_method.py