Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

C# -> VB error with step <0 #798

Closed
marco402 opened this issue Dec 8, 2021 · 1 comment
Closed

C# -> VB error with step <0 #798

marco402 opened this issue Dec 8, 2021 · 1 comment
Labels
C# -> VB Specific to C# -> VB conversion good first issue help wanted output logic error A bug where the converted output behaves differently to the input code

Comments

@marco402
Copy link

marco402 commented Dec 8, 2021

CodeC#:
for (int m=nbMessage;m>0;m--)

CodeConverter:
For m As Integer = nbMessage To 0 + 1

Code VBNET
For m As Integer = nbMessage To 1 Step -1

Marc

@GrahamTheCoder GrahamTheCoder added C# -> VB Specific to C# -> VB conversion good first issue help wanted labels Dec 10, 2021
@GrahamTheCoder GrahamTheCoder added the output logic error A bug where the converted output behaves differently to the input code label Dec 30, 2021
@GrahamTheCoder
Copy link
Member

GrahamTheCoder commented Dec 31, 2021

I could not reproduce the issue shown. There are existing tests which demonstrate the Step -1 is correctly added. I've added an extra test that even more closely matches your example.

It's possible you were using a very old version of the converter (e.g. the one Telerik hosts). If you are still seeing this issue, please try to provide some example code that reproduces the issue on the latest version: https://codeconverter.icsharpcode.net/

e.g.

await TestConversionCSharpToVisualBasicAsync(@"class TestClass
{
void TestMethod(int[] b, int[] s, int nbMessage)
{
for (int m=nbMessage;m>0;m--)
{
// Loop body
}
}
}", @"Friend Class TestClass

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C# -> VB Specific to C# -> VB conversion good first issue help wanted output logic error A bug where the converted output behaves differently to the input code
Projects
None yet
Development

No branches or pull requests

2 participants