Skip to content

Commit 5b09ba6

Browse files
authored
Parameters marked with ParameterAttributes.Out are no longer returned in addition to the regular method return value (unless they are passed with ref or out keyword). (#1308)
1 parent 57f4a80 commit 5b09ba6

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ This document follows the conventions laid out in [Keep a CHANGELOG][].
1818
details about the cause of the failure
1919
- `clr.AddReference` no longer adds ".dll" implicitly
2020
- `PyIter(PyObject)` constructor replaced with static `PyIter.GetIter(PyObject)` method
21-
- Return values from .NET methods that return an interface are now automatically
21+
- BREAKING: Return values from .NET methods that return an interface are now automatically
2222
wrapped in that interface. This is a breaking change for users that rely on being
2323
able to access members that are part of the implementation class, but not the
2424
interface. Use the new __implementation__ or __raw_implementation__ properties to
2525
if you need to "downcast" to the implementation class.
26+
- BREAKING: Parameters marked with `ParameterAttributes.Out` are no longer returned in addition
27+
to the regular method return value (unless they are passed with `ref` or `out` keyword).
2628

2729
### Fixed
2830

src/runtime/methodbinder.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
534534
Runtime.XDecref(op);
535535
}
536536

537-
if (parameter.IsOut || isOut)
537+
if (isOut)
538538
{
539539
outs++;
540540
}

src/tests/test_method.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ def test_we_can_bind_to_encoding_get_string():
761761
read = 1
762762

763763
while read > 0:
764-
read, _ = stream.Read(buff, 0, buff.Length)
764+
read = stream.Read(buff, 0, buff.Length)
765765
temp = Encoding.UTF8.GetString(buff, 0, read)
766766
data.append(temp)
767767

0 commit comments

Comments
 (0)