| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 75f4398 commit f69753c
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,3 +84,4 @@ | |||
| 84 | 84 | - ([@DanBarzilian](https://github.com/DanBarzilian)) | |
| 85 | 85 | - ([@alxnull](https://github.com/alxnull)) | |
| 86 | 86 | - ([@gpetrou](https://github.com/gpetrou)) | |
| 87 | + - Ehsan Iran-Nejad ([@eirannejad](https://github.com/eirannejad)) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -109,6 +109,7 @@ Instead, `PyIterable` does that. | |||
| 109 | 109 | - Empty parameter names (as can be generated from F#) do not cause crashes | |
| 110 | 110 | - Unicode strings with surrogates were truncated when converting from Python | |
| 111 | 111 | - `Reload` mode now supports generic methods (previously Python would stop seeing them after reload) | |
| 112 | + - Temporarily fixed issue resolving method overload when method signature has `out` parameters ([#1672](i1672)) | ||
| 112 | 113 | ||
| 113 | 114 | ### Removed | |
| 114 | 115 | ||
@@ -881,3 +882,4 @@ This version improves performance on benchmarks significantly compared to 2.3. | |||
| 881 | 882 | [i1342]: https://github.com/pythonnet/pythonnet/issues/1342 | |
| 882 | 883 | [i238]: https://github.com/pythonnet/pythonnet/issues/238 | |
| 883 | 884 | [i1481]: https://github.com/pythonnet/pythonnet/issues/1481 | |
| 885 | + [i1672]: https://github.com/pythonnet/pythonnet/pull/1672 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -632,6 +632,11 @@ static BorrowedReference HandleParamsArray(BorrowedReference args, int arrayStar | |||
| 632 | 632 | margs[paramIndex] = defaultArgList[paramIndex - pyArgCount]; | |
| 633 | 633 | } | |
| 634 | 634 | ||
| 635 | + if (parameter.ParameterType.IsByRef) | ||
| 636 | + { | ||
| 637 | + outs++; | ||
| 638 | + } | ||
| 639 | + | ||
| 635 | 640 | continue; | |
| 636 | 641 | } | |
| 637 | 642 | ||
@@ -817,6 +822,9 @@ static bool MatchesArgumentCount(int positionalArgumentCount, ParameterInfo[] pa | |||
| 817 | 822 | defaultArgList.Add(parameters[v].GetDefaultValue()); | |
| 818 | 823 | defaultsNeeded++; | |
| 819 | 824 | } | |
| 825 | + else if (parameters[v].IsOut) { | ||
| 826 | + defaultArgList.Add(null); | ||
| 827 | + } | ||
| 820 | 828 | else if (!paramsArray) | |
| 821 | 829 | { | |
| 822 | 830 | match = false; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -280,6 +280,16 @@ def test_string_out_params(): | |||
| 280 | 280 | assert result[1] == "output string" | |
| 281 | 281 | ||
| 282 | 282 | ||
| 283 | + def test_string_out_params_without_passing_string_value(): | ||
| 284 | + """Test use of string out-parameters.""" | ||
| 285 | + # @eirannejad 2022-01-13 | ||
| 286 | + result = MethodTest.TestStringOutParams("hi") | ||
| 287 | + assert isinstance(result, tuple) | ||
| 288 | + assert len(result) == 2 | ||
| 289 | + assert result[0] is True | ||
| 290 | + assert result[1] == "output string" | ||
| 291 | + | ||
| 292 | + | ||
| 283 | 293 | def test_string_ref_params(): | |
| 284 | 294 | """Test use of string byref parameters.""" | |
| 285 | 295 | result = MethodTest.TestStringRefParams("hi", "there") | |
@@ -308,6 +318,16 @@ def test_value_out_params(): | |||
| 308 | 318 | MethodTest.TestValueOutParams("hi", None) | |
| 309 | 319 | ||
| 310 | 320 | ||
| 321 | + def test_value_out_params_without_passing_string_value(): | ||
| 322 | + """Test use of string out-parameters.""" | ||
| 323 | + # @eirannejad 2022-01-13 | ||
| 324 | + result = MethodTest.TestValueOutParams("hi") | ||
| 325 | + assert isinstance(result, tuple) | ||
| 326 | + assert len(result) == 2 | ||
| 327 | + assert result[0] is True | ||
| 328 | + assert result[1] == 42 | ||
| 329 | + | ||
| 330 | + | ||
| 311 | 331 | def test_value_ref_params(): | |
| 312 | 332 | """Test use of value type byref parameters.""" | |
| 313 | 333 | result = MethodTest.TestValueRefParams("hi", 1) | |
@@ -336,6 +356,15 @@ def test_object_out_params(): | |||
| 336 | 356 | assert isinstance(result[1], System.Exception) | |
| 337 | 357 | ||
| 338 | 358 | ||
| 359 | + def test_object_out_params_without_passing_string_value(): | ||
| 360 | + """Test use of object out-parameters.""" | ||
| 361 | + result = MethodTest.TestObjectOutParams("hi") | ||
| 362 | + assert isinstance(result, tuple) | ||
| 363 | + assert len(result) == 2 | ||
| 364 | + assert result[0] is True | ||
| 365 | + assert isinstance(result[1], System.Exception) | ||
| 366 | + | ||
| 367 | + | ||
| 339 | 368 | def test_object_ref_params(): | |
| 340 | 369 | """Test use of object byref parameters.""" | |
| 341 | 370 | result = MethodTest.TestObjectRefParams("hi", MethodTest()) | |
@@ -364,6 +393,15 @@ def test_struct_out_params(): | |||
| 364 | 393 | MethodTest.TestValueRefParams("hi", None) | |
| 365 | 394 | ||
| 366 | 395 | ||
| 396 | + def test_struct_out_params_without_passing_string_value(): | ||
| 397 | + """Test use of struct out-parameters.""" | ||
| 398 | + result = MethodTest.TestStructOutParams("hi") | ||
| 399 | + assert isinstance(result, tuple) | ||
| 400 | + assert len(result) == 2 | ||
| 401 | + assert result[0] is True | ||
| 402 | + assert isinstance(result[1], System.Guid) | ||
| 403 | + | ||
| 404 | + | ||
| 367 | 405 | def test_struct_ref_params(): | |
| 368 | 406 | """Test use of struct byref parameters.""" | |
| 369 | 407 | result = MethodTest.TestStructRefParams("hi", System.Guid.NewGuid()) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments