Skip to content

Commit a22c24c

Browse files
Timur KelmanTimur Kelman
authored andcommitted
add a test for ByRef const argument
1 parent fc0a1e6 commit a22c24c

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Tests/CSharp/MemberTests/MemberTests.cs

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4047,6 +4047,40 @@ public static int StaticTestProperty
40474047
return _StaticTestProperty_sPrevPosition + 1;
40484048
}
40494049
}
4050+
}");
4051+
}
4052+
4053+
[Fact]
4054+
public async Task TestRefConstArgumentAsync()
4055+
{
4056+
await TestConversionVisualBasicToCSharpAsync(
4057+
@"Class RefConstArgument
4058+
Const a As String = ""a""
4059+
Sub S()
4060+
Const b As String = ""b""
4061+
MO(a)
4062+
MS(b)
4063+
End Sub
4064+
Sub MO(ByRef s As Object) : End Sub
4065+
Sub MS(ByRef s As String) : End Sub
4066+
End Class", @"
4067+
internal partial class RefConstArgument
4068+
{
4069+
private const string a = ""a"";
4070+
public void S()
4071+
{
4072+
const string b = ""b"";
4073+
object args = a;
4074+
MO(ref args);
4075+
string args1 = b;
4076+
MS(ref args1);
4077+
}
4078+
public void MO(ref object s)
4079+
{
4080+
}
4081+
public void MS(ref string s)
4082+
{
4083+
}
40504084
}");
40514085
}
40524086
}

0 commit comments

Comments
 (0)