Skip to content

Commit

Permalink
Added one more test case for ref out
Browse files Browse the repository at this point in the history
  • Loading branch information
liiir1985 committed Jul 25, 2022
1 parent 2ae204b commit 64d85c7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions TestCases/RefOutTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,25 @@ public static void UnitTest_RefTest3()
Console.WriteLine(arr[1]);
}

public static void Set(ref long x)
{
x++;
}

public static void UnitTest_RefTest4()
{
long srcX = 10;

for (var index = 0; index < 10; index++)
{
long x = srcX;
Console.WriteLine(x);
if (x != 10)
throw new Exception();
Set(ref x);
}
}

static void Func(ref int[] arr)
{
arr[1] = 2;
Expand Down

0 comments on commit 64d85c7

Please sign in to comment.