Skip to content

Commit

Permalink
add tests for With ref-return properties
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Kelman authored and Timur Kelman committed Jul 19, 2024
1 parent f3497e3 commit 79d6f8a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,15 @@
Dim lst As CSharpRefReturn.RefReturnList(Of SomeStruct)
Dim s As String

'With lst(0)
' .P = s
' s = .P
'End With
With lst(0)
.P = s
s = .P
End With

With lst.RefProperty
.P = s
s = .P
End With
End Sub

Structure SomeStruct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,20 @@ public void UseArr()

public void UseRefReturn()
{
CSharpRefReturn.RefReturnList<SomeStruct> lst;
string s;
var lst = default(CSharpRefReturn.RefReturnList<SomeStruct>);
var s = default(string);

{
ref var withBlock = ref lst[0];
withBlock.P = s;
s = withBlock.P;
}

// With lst(0)
// .P = s
// s = .P
// End With
{
ref var withBlock1 = ref lst.RefProperty;
withBlock1.P = s;
s = withBlock1.P;
}
}

public struct SomeStruct
Expand Down

0 comments on commit 79d6f8a

Please sign in to comment.