Skip to content

Commit

Permalink
Parameters marked with ParameterAttributes.Out are no longer return…
Browse files Browse the repository at this point in the history
…ed in addition to the regular method return value (unless they are passed with `ref` or `out` keyword).
  • Loading branch information
lostmsu committed Dec 8, 2020
1 parent 57f4a80 commit b7e2699
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ details about the cause of the failure
able to access members that are part of the implementation class, but not the
interface. Use the new __implementation__ or __raw_implementation__ properties to
if you need to "downcast" to the implementation class.
- 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).

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/methodbinder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ static object[] TryConvertArguments(ParameterInfo[] pi, bool paramsArray,
Runtime.XDecref(op);
}

if (parameter.IsOut || isOut)
if (isOut)
{
outs++;
}
Expand Down
2 changes: 1 addition & 1 deletion src/tests/test_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ def test_we_can_bind_to_encoding_get_string():
read = 1

while read > 0:
read, _ = stream.Read(buff, 0, buff.Length)
read = stream.Read(buff, 0, buff.Length)
temp = Encoding.UTF8.GetString(buff, 0, read)
data.append(temp)

Expand Down

0 comments on commit b7e2699

Please sign in to comment.