Skip to content

'Make method async' breaks overridden methods #33082

@miloush

Description

@miloush

Version Used: VS 2019 Preview 2.1

Steps to Reproduce:

partial class MyPage : Page
{
    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        await Task.Delay(100);
    }
}

Actual Behavior:

  1. 'Make method async' is offered that changes the return type and renames the method.
  2. 'Make method async (stay void) is offered that renames the method.

Expected Behavior:

  1. Should not be offered as it is not really an option for an overridden method.
  2. That is the quick fix I was looking for, but it should not rename the method as it breaks the override.

#20348

Metadata

Metadata

Assignees

Labels

Area-IDEBugIDE-CodeStyleBuilt-in analyzers, fixes, and refactoringsResolution-FixedThe bug has been fixed and/or the requested behavior has been implemented

Type

No type
No fields configured for issues without a type.

Projects

Status

Complete

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions