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#: Async Function doesn't translate to async lambda #657

Closed
brantburnett opened this issue Oct 14, 2020 · 1 comment · Fixed by #693
Closed

VB -> C#: Async Function doesn't translate to async lambda #657

brantburnett opened this issue Oct 14, 2020 · 1 comment · Fixed by #693
Labels
compilation error A bug where the converted output won't compile good first issue VB -> C# Specific to VB -> C# conversion

Comments

@brantburnett
Copy link

Input code

Return Await Me.ExecuteAuthenticatedAsync(Async Function()
    Return Await DoSomethingAsync()
End Function)

Erroneous output

return await this.ExecuteAuthenticatedAsync(() => {
    return await DoSomethingAsync();
});

Expected output

return await this.ExecuteAuthenticatedAsync(async () => {
    return await DoSomethingAsync();
});

Details

  • Product in use: VS extension
  • Version in use: 8.1.8.0
@brantburnett brantburnett added the VB -> C# Specific to VB -> C# conversion label Oct 14, 2020
@GrahamTheCoder GrahamTheCoder added compilation error A bug where the converted output won't compile good first issue labels Oct 14, 2020
@GrahamTheCoder
Copy link
Member

Thanks for posting. The code around lambdas has a lot of cases, some are likely missing code like this

if (operation.Symbol.IsAsync) methodDecl = methodDecl.AddModifiers(SyntaxFactory.Token(SyntaxKind.AsyncKeyword));

So probably a few test cases needed but should be a straightforward change.

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 good first issue VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants