File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -131,6 +131,26 @@ public static string TestOverloadedObject(object o)
131131 return "Got object" ;
132132 }
133133
134+ public static string TestOverloadedObjectTwo ( int a , int b )
135+ {
136+ return "Got int-int" ;
137+ }
138+
139+ public static string TestOverloadedObjectTwo ( int a , object b )
140+ {
141+ return "Got int-object" ;
142+ }
143+
144+ public static string TestOverloadedObjectTwo ( object a , int b )
145+ {
146+ return "Got object-int" ;
147+ }
148+
149+ public static string TestOverloadedObjectTwo ( object a , object b )
150+ {
151+ return "Got object-object" ;
152+ }
153+
134154 public static bool TestStringOutParams ( string s , out string s1 )
135155 {
136156 s1 = "output string" ;
Original file line number Diff line number Diff line change @@ -790,3 +790,19 @@ def test_object_in_param():
790790
791791 res = MethodTest .TestOverloadedObject ("test" )
792792 assert res == "Got object"
793+
794+
795+ def test_object_in_multiparam ():
796+ """Test method with object multiparams behaves"""
797+
798+ res = MethodTest .TestOverloadedObjectTwo (5 , 5 )
799+ assert res == "Got int-int"
800+
801+ res = MethodTest .TestOverloadedObjectTwo (5 , "foo" )
802+ assert res == "Got int-object"
803+
804+ res = MethodTest .TestOverloadedObjectTwo ("foo" , 5 )
805+ assert res == "Got object-int"
806+
807+ res = MethodTest .TestOverloadedObjectTwo ("foo" , "bar" )
808+ assert res == "Got object-object"
You can’t perform that action at this time.
0 commit comments