Skip to content

"Extract base class" and "Pull member up" drop partial modifier from events #81066

@jhinder

Description

@jhinder

Version Used: VS 18.0.0 Insiders

Steps to Reproduce:
On the class definition, open the lightbulb menu, select "Extract base class". In the dialog, select all members and confirm.

partial class C
{
    public partial void M();
    public partial void M() { }

    public partial int P { get; }
    public partial int P => 0;

    public partial event EventHandler E;
    public partial event EventHandler E { add { } remove { } }
}

Expected Behavior:
All members retain their partial modifiers.

Actual Behavior:
The method and the property retain their partial modifier, the event loses it.

internal class CBase
{
    public partial int P { get; }

    public event EventHandler E;

    public partial void M();
}

The same behaviour happens when there already is a base class and you select "Pull (symbol) up" on it.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions