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#: Erroneous new keyword #431

Closed
mrmonday opened this issue Nov 19, 2019 · 2 comments
Closed

VB -> C#: Erroneous new keyword #431

mrmonday opened this issue Nov 19, 2019 · 2 comments
Labels
VB -> C# Specific to VB -> C# conversion

Comments

@mrmonday
Copy link
Contributor

Please prefix the issue title with either "C# -> VB: " or "VB -> C#: " if relevant

Input code

Class Base
    Public Sub Add(ByVal key As String, ByVal obj As Object)
    End Sub
End Class

Class Derived
    Inherits Base

    Public Overloads Sub Add(ByRef obj As Object)

    End Sub
End Class

Erroneous output

class Base
{
    public void Add(string key, object obj)
    {
    }
}

class Derived : Base
{
    public new void Add(ref object obj)
    {
    }
}

Expected output

class Base
{
    public void Add(string key, object obj)
    {
    }
}

class Derived : Base
{
    public void Add(ref object obj)
    {
    }
}

Details

  • Version in use: 7.2.0

Warning:

warning CS0109: The member 'Derived.Add(ref object)' does not hide an accessible member. The new keyword is not required.
@GrahamTheCoder
Copy link
Member

GrahamTheCoder commented Nov 19, 2019

Similar: #351 I've closed the other issue as duplicate since this is better formatted, but worth checking in case it has a different test case on it.

@GrahamTheCoder
Copy link
Member

Duplicate of #504 - see that for details of the recent fix

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