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#: Unnecessary Conversions.ToString() in string concatenation #508

Closed
mrmonday opened this issue Jan 22, 2020 · 1 comment
Closed
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@mrmonday
Copy link
Contributor

Input code

Public Class VisualBasicClass
    Sub Foo()
        Dim x = "x" & 4 & "y"
    End Sub
End Class

Erroneous output

using Microsoft.VisualBasic.CompilerServices;

public partial class VisualBasicClass
{
    public void Foo()
    {
        string x = "x" + Conversions.ToString(4) + "y";
    }
}

Expected output

using Microsoft.VisualBasic.CompilerServices;

public partial class VisualBasicClass
{
    public void Foo()
    {
        string x = "x" + 4 + "y";
    }
}

Details

  • Product in use: codeconverter.icsharpcode.net
  • Version in use: 7.6.0

Explicit conversions to string are not necessary in string concatenation.

@mrmonday mrmonday added the VB -> C# Specific to VB -> C# conversion label Jan 22, 2020
@GrahamTheCoder GrahamTheCoder modified the milestones: 8.1.0, 8.1.0 candidate Mar 20, 2020
@Saibamen
Copy link
Contributor

Please retest with recent version

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

3 participants