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

[EnC] Allow deleting method #61806

Merged
merged 44 commits into from Jun 28, 2022
Merged

Conversation

davidwengier
Copy link
Contributor

@davidwengier davidwengier commented Jun 10, 2022

Fixes #61678
Part of #59264

This allows deleting a method in Edit and Continue/Hot Reload. When deleted, we emit a method that throws MissingMethodException in its place. If a method by the same is name is re-added, we emit an update, as though the method wasn't deleted in the first place.

}
""",
edits: new[] {
Edit(SemanticEditKind.Insert, symbolProvider: c => c.GetMember("C.M1")),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SemanticEditKind.Insert

Did I see a comment elsewhere that adding a method back would be treated as an update rather than an add (or insert)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but only during emit. So the analyzer still sees it as an insert and still reports the semantic edit as such, which is what this represents, but then in DeltaMetadataWriter (here) that gets treated as an update.

@davidwengier davidwengier requested a review from tmat June 24, 2022 06:44
@davidwengier
Copy link
Contributor Author

@dotnet/roslyn-compiler for a second review, please

@davidwengier
Copy link
Contributor Author

Ping @tmat

Copy link
Member

@tmat tmat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@tmat
Copy link
Member

tmat commented Jun 27, 2022

Just a few minor things.

@davidwengier davidwengier enabled auto-merge (squash) June 28, 2022 00:16
@davidwengier davidwengier merged commit a301583 into dotnet:main Jun 28, 2022
@ghost ghost added this to the Next milestone Jun 28, 2022
@davidwengier davidwengier deleted the EnCDeleteMethod branch June 28, 2022 03:39
@tmat
Copy link
Member

tmat commented Jun 28, 2022

Nice!

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

Successfully merging this pull request may close these issues.

EnC: Allow deleting methods
5 participants