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#: deal with using alias in imports : Imports VB = Microsoft.VisualBasic #401

Closed
v1nce opened this issue Oct 28, 2019 · 2 comments · Fixed by #414
Closed

VB -> C#: deal with using alias in imports : Imports VB = Microsoft.VisualBasic #401

v1nce opened this issue Oct 28, 2019 · 2 comments · Fixed by #414

Comments

@v1nce
Copy link

@v1nce v1nce commented Oct 28, 2019

Input code

Imports VB = Microsoft.VisualBasic
...
copy = VB.Left(sometext, i_1)
If relevant, please enter some example code here to reproduce the issue (in VB or C#), or the steps taken to cause the issue.

Erroneous output

copy = Microsoft.VB.Left(sometext, i_1);
			

Expected output

copy = Microsoft.VisualBasic.Left(sometext, i_1); // which would be wrong
...or better...
copy =Microsoft.VisualBasic.Strings.Left(sometext, i_1);  
...or...
using VB= Microsoft.VisualBasic;
copy =VB.Strings.Left(sometext, i_1);  

Details

  • Product in use: VS extension
  • Version in use: 7.2.0.0
@GrahamTheCoder

This comment has been minimized.

Copy link
Member

@GrahamTheCoder GrahamTheCoder commented Nov 10, 2019

Should probably be tackled in conjunction to #375

@GrahamTheCoder

This comment has been minimized.

Copy link
Member

@GrahamTheCoder GrahamTheCoder commented Nov 11, 2019

        [Fact]
        public async Task AliasedImportsWithTypePromotion()
        {
            await TestConversionVisualBasicToCSharp(
                @"Imports VB = Microsoft.VisualBasic

Public Class Test
    Private aliased = VB.Left(""SomeText"", 1)
End Class",
                @"using VB = Microsoft.VisualBasic;

public partial class Test
{
    private string aliased = Microsoft.VisualBasic.Strings.Left(""SomeText"", 1);
}");
        }
mrmonday added a commit to mrmonday/CodeConverter that referenced this issue Nov 12, 2019
mrmonday added a commit to mrmonday/CodeConverter that referenced this issue Nov 12, 2019
mrmonday added a commit to mrmonday/CodeConverter that referenced this issue Nov 13, 2019
GrahamTheCoder added a commit that referenced this issue Nov 14, 2019
Correctly handle type promoted module symbols [#332, #375, #401]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.