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#: Conversion of ValueTuple causes compile error #1027

Open
AlanC7007 opened this issue Jul 31, 2023 · 1 comment
Open

VB -> C#: Conversion of ValueTuple causes compile error #1027

AlanC7007 opened this issue Jul 31, 2023 · 1 comment
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@AlanC7007
Copy link

VB.Net input code

Function Foo() As ValueTuple(Of Double, Double)
  Return New ValueTuple(Of Double, Double)(1, 2)
End Function

Erroneous output

public (double, double) Foo()
{
  return new (double, double)(1d, 2d);
}

Expected output

public (double, double) Foo()
{
  return (1d, 2d);
}

Details

  • Removing the “new (double, double)” fixes the compile error
@AlanC7007 AlanC7007 added the VB -> C# Specific to VB -> C# conversion label Jul 31, 2023
@GrahamTheCoder
Copy link
Member

Thanks for the report. It looks likely there's an upstream bug in the roslyn simplifier, but it would be easy to work around in this tool too with a special case in something like VisitObjectCreationExpression

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
VB -> C# Specific to VB -> C# conversion
Projects
None yet
Development

No branches or pull requests

2 participants