| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bc414e1 commit 4692e68
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -269,10 +269,8 @@ internal Binding Bind(IntPtr inst, IntPtr args, IntPtr kw, | |||
| 269 | 269 | defaultArgList.Add((object)pi[v].DefaultValue); | |
| 270 | 270 | } | |
| 271 | 271 | } else if ((pynargs > clrnargs) && (clrnargs > 0) && | |
| 272 | - (pi[clrnargs-1].ParameterType.IsArray)) { | ||
| 273 | - // The last argument of the mananged functions seems to | ||
| 274 | - // accept multiple arguments as a array. Hopefully it's a | ||
| 275 | - // spam(params object[] egg) style method | ||
| 272 | + Attribute.IsDefined(pi[clrnargs-1], typeof(ParamArrayAttribute))) { | ||
| 273 | + // This is a spam(params object[] egg) style method | ||
| 276 | 274 | match = true; | |
| 277 | 275 | arrayStart = clrnargs - 1; | |
| 278 | 276 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -117,6 +117,14 @@ public static bool TestStringRefParams (string s, ref string s1) { | |||
| 117 | 117 | return true; | |
| 118 | 118 | } | |
| 119 | 119 | ||
| 120 | + public static bool TestNonParamsArrayInLastPlace(int i1, int[] i2) { | ||
| 121 | + return false; | ||
| 122 | + } | ||
| 123 | + | ||
| 124 | + public static bool TestNonParamsArrayInLastPlace(int i1, int i2, int i3) { | ||
| 125 | + return true; | ||
| 126 | + } | ||
| 127 | + | ||
| 120 | 128 | public static bool TestValueOutParams (string s, out int i1) { | |
| 121 | 129 | i1 = 42; | |
| 122 | 130 | return true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -304,6 +304,10 @@ def testValueParamsArgs(self): | |||
| 304 | 304 | self.assertTrue(result[1] == 2) | |
| 305 | 305 | self.assertTrue(result[2] == 3) | |
| 306 | 306 | ||
| 307 | + def testNonParamsArrayInLastPlace(self): | ||
| 308 | + """Test overload resolution with of non-"params" array as last parameter.""" | ||
| 309 | + result = MethodTest.TestNonParamsArrayInLastPlace(1, 2, 3) | ||
| 310 | + self.assertTrue(result) | ||
| 307 | 311 | ||
| 308 | 312 | def testStringOutParams(self): | |
| 309 | 313 | """Test use of string out-parameters.""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments