dotnet/roslyn

Make Method Async renames wrong method if a method with the same name already exists

Open

#47,155 opened on Aug 26, 2020

View on GitHub
 (3 comments) (0 reactions) (0 assignees)C# (4,257 forks)batch import
Area-IDEBugFeature - Renamehelp wanted

Repository metrics

Stars
 (20,414 stars)
PR merge metrics
 (Avg merge 6d 17h) (256 merged PRs in 30d)

Description

Version Used: VS 16.7.2

Steps to Reproduce: Create the following Methods

        static int Foo()
        {
            return 42;
        }

        static int Foo()
        {
            await Task.Delay(42);
            return 1;
        }

Place the cursor on the await and select Make method async refactoring Expected Behavior:

        static int Foo()
        {
            return 42;
        }

        static async Task<int> FooAsync()
        {
            await Task.Delay(42);
            return 1;
        }

Actual Behavior:

        static int FooAsync()
        {
            return 42;
        }

        static async Task<int> Foo()
        {
            await Task.Delay(42);
            return 1;
        }

Contributor guide