Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

VB -> C#: Incorrect type in for loop with missing semantic info #482

Open
mrmonday opened this issue Jan 6, 2020 · 0 comments
Open

VB -> C#: Incorrect type in for loop with missing semantic info #482

mrmonday opened this issue Jan 6, 2020 · 0 comments
Labels

Comments

@mrmonday
Copy link
Contributor

@mrmonday mrmonday commented Jan 6, 2020

Input code

Class A
    Public Sub Test()
        Dim x As Asadf = Nothing

        For i = 1 To x.SomeInteger

        Next
    End Sub
End Class

Erroneous output

class A
{
    public void Test()
    {
        Asadf x = null;

        for (object i = 1, loopTo = x.SomeInteger; i <= loopTo; i++)
        {
        }
    }
}

Expected output

class A
{
    public void Test()
    {
        Asadf x = null;

        for (int i = 1, loopTo = x.SomeInteger; i <= loopTo; i++)
        {
        }
    }
}

Details

Using master @ dadc812.

The type could either default to int, or be infered from the RHS.

@mrmonday mrmonday added the VB -> C# label Jan 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.