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#: Self invoking lambda functions are converted incorrectly #869

Closed
jrmoreno1 opened this issue Apr 9, 2022 · 0 comments
Closed
Labels
compilation error A bug where the converted output won't compile VB -> C# Specific to VB -> C# conversion

Comments

@jrmoreno1
Copy link
Contributor

VB.Net input code

Public Class VisualBasicClass
    Sub Main
        Dim i As Integer = Function() 
                                Return 2 
                        End Function() 
        Console.WriteLine(i)
    End Sub
End Class

Erroneous output

public partial class VisualBasicClass
{
    public void Main()
    {
        int i = () => 2();
        Console.WriteLine(i);
    }
}

Expected output

public partial class VisualBasicClass
{
    public void Main()
    {
        int i = ((Func<int>)(() => 2))();
        Console.WriteLine(i);
    }
}

Details

@jrmoreno1 jrmoreno1 added the VB -> C# Specific to VB -> C# conversion label Apr 9, 2022
@GrahamTheCoder GrahamTheCoder added the compilation error A bug where the converted output won't compile label Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compilation error A bug where the converted output won't compile VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

2 participants