Merge pull request #377 from vmuriart/method_object · pythonnet/pythonnet@8f258ac · GitHub
Skip to content

Commit 8f258ac

Browse files
authored
Merge pull request #377 from vmuriart/method_object
Method overload object type
2 parents 909b7c0 + 4071aa3 commit 8f258ac

3 files changed

Lines changed: 116 additions & 1 deletion

File tree

src/runtime/methodbinder.cs

Lines changed: 1 addition & 1 deletion

src/testing/methodtest.cs

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,71 @@ public static int[] TestOverloadedParams(int v, int[] args)
116116
return args;
117117
}
118118

119+
public static string TestOverloadedNoObject(int i)
120+
{
121+
return "Got int";
122+
}
123+
124+
public static string TestOverloadedObject(int i)
125+
{
126+
return "Got int";
127+
}
128+
129+
public static string TestOverloadedObject(object o)
130+
{
131+
return "Got object";
132+
}
133+
134+
public static string TestOverloadedObjectTwo(int a, int b)
135+
{
136+
return "Got int-int";
137+
}
138+
139+
public static string TestOverloadedObjectTwo(string a, string b)
140+
{
141+
return "Got string-string";
142+
}
143+
144+
public static string TestOverloadedObjectTwo(string a, int b)
145+
{
146+
return "Got string-int";
147+
}
148+
149+
public static string TestOverloadedObjectTwo(string a, object b)
150+
{
151+
return "Got string-object";
152+
}
153+
154+
public static string TestOverloadedObjectTwo(int a, object b)
155+
{
156+
return "Got int-object";
157+
}
158+
159+
public static string TestOverloadedObjectTwo(object a, int b)
160+
{
161+
return "Got object-int";
162+
}
163+
164+
public static string TestOverloadedObjectTwo(object a, object b)
165+
{
166+
return "Got object-object";
167+
}
168+
169+
public static string TestOverloadedObjectTwo(int a, string b)
170+
{
171+
return "Got int-string";
172+
}
173+
174+
public static string TestOverloadedObjectThree(object a, int b)
175+
{
176+
return "Got object-int";
177+
}
178+
179+
public static string TestOverloadedObjectThree(int a, object b)
180+
{
181+
return "Got int-object";
182+
}
183+
119184
public static bool TestStringOutParams(string s, out string s1)
120185
{
121186
s1 = "output string";

src/tests/test_method.py

Lines changed: 50 additions & 0 deletions

0 commit comments

Comments
 (0)