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

MSTEST0036 is shown for cases where no shadowing happens #3824

Open
cremor opened this issue Sep 13, 2024 · 1 comment
Open

MSTEST0036 is shown for cases where no shadowing happens #3824

cremor opened this issue Sep 13, 2024 · 1 comment

Comments

@cremor
Copy link

cremor commented Sep 13, 2024

Describe the bug

The following code shows MSTEST0036 (Do not use shadowing inside test class) even though no shadowing happens.

Steps To Reproduce

namespace TestProject1;

[TestClass]
public class BaseTest
{
    protected TObject CreateObject<TObject>()
    {
        throw new NotImplementedException();
    }
}

[TestClass]
public class ExtendedTest : BaseTest
{
    // MSTEST0036 is shown here
    private SomeType CreateObject()
    {
        throw new NotImplementedException();
    }
}

public class SomeType;

Expected behavior

No MSTEST0036 warning.

Actual behavior

MSTEST0036 is shown.

Additional context

This is a new problem in v3.6.0

I actually see MSTEST0036 twice in the error list - with different messages. It seems like one is from IntelliSense and the other one from actually building the project.

And the message "is already exist" should be fixed to be correct English.

grafik

@Evangelink
Copy link
Member

Hi @cremor!

Thanks for the bug report, indeed there are a few problems. We will work on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants