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

Open
mrmonday opened this issue Nov 19, 2019 · 1 comment
Open

VB -> C#: Erroneous new keyword #431

mrmonday opened this issue Nov 19, 2019 · 1 comment
Labels

Comments

@mrmonday
Copy link
Contributor

@mrmonday mrmonday commented Nov 19, 2019

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

This comment has been minimized.

Copy link
Member

@GrahamTheCoder 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.

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.