Skip to content

Exception is thrown in SyntaxEditor when adding a delegate declaration to an interface declaration #78860

Open
@bjornhellander

Description

@bjornhellander

Version Used:

4.12.0

Steps to Reproduce:

The following code results in an exception being thrown if parent is an interface declaration and newMember is a delegate declaration:

var syntaxEditor = new SyntaxEditor(orgSyntaxRoot, workspace);
syntaxEditor.AddMember(parent, newMember);
var newSyntaxRoot = syntaxEditor.GetChangedRoot(); // Exception here!

Seems to end up here:

throw ExceptionUtilities.UnexpectedValue(member.Kind());

Expected Behavior:
A new syntax root with the new member added to the parent.

Actual Behavior:
InvalidOperationException is thrown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-IDEhelp wantedThe issue is "up for grabs" - add a comment if you are interested in working on it

    Type

    Projects

    Status

    InQueue

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions