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#: Namespaces with different cases merged #421

Closed
mrmonday opened this issue Nov 14, 2019 · 1 comment · Fixed by #424
Closed

VB -> C#: Namespaces with different cases merged #421

mrmonday opened this issue Nov 14, 2019 · 1 comment · Fixed by #424
Labels
compilation error A bug where the converted output won't compile VB -> C# Specific to VB -> C# conversion

Comments

@mrmonday
Copy link
Contributor

mrmonday commented Nov 14, 2019

Input code

Namespace [Aaa]
    Friend Class A
    End Class
End Namespace

Namespace Global.aaa
    Friend Class B
    End Class
End Namespace

Friend Module C
    Sub Main()
        Dim x = New aaa.A
        Dim y = New Aaa.B
    End Sub
End Module

Erroneous output

namespace Aaa
{
    internal class A
    {
    }
}

namespace Aaa
{
    internal class B
    {
    }
}

internal static class C
{
    public static void Main()
    {
        var x = new Aaa.A();
        var y = new Aaa.B();
    }
}

Expected output

namespace Aaa
{
    internal class A
    {
    }
}

namespace aaa
{
    internal class B
    {
    }
}

internal static class C
{
    public static void Main()
    {
        var x = new Aaa.A();
        var y = new aaa.B();
    }
}

Details

  • Version in use: 7.3.0

The original VB is hard to enter in VS, since it likes to auto-correct. The original case was cross-project, where it's easier to achieve (but harder to put into a test case). According to ILSpy this does end up as two different namespaces.

mrmonday added a commit to mrmonday/CodeConverter that referenced this issue Nov 14, 2019
mrmonday added a commit to mrmonday/CodeConverter that referenced this issue Nov 15, 2019
@GrahamTheCoder GrahamTheCoder added compilation error A bug where the converted output won't compile VB -> C# Specific to VB -> C# conversion labels Nov 15, 2019
@GrahamTheCoder
Copy link
Member

I've tagged this as compilation error since I believe it's a source (and binary) level break for C# referencing the converted assembly.

GrahamTheCoder pushed a commit to mrmonday/CodeConverter that referenced this issue Nov 17, 2019
GrahamTheCoder pushed a commit to mrmonday/CodeConverter that referenced this issue Nov 19, 2019
GrahamTheCoder added a commit that referenced this issue Nov 19, 2019
Ensure casing matches for namespaces [#421]
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

Successfully merging a pull request may close this issue.

2 participants