Skip to content

Implement InstantiateSignature on AsyncMethodVariant/EcmaMethod - #121948

Merged
MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:instsig
Nov 25, 2025
Merged

MichalStrehovsky merged 1 commit into
dotnet:mainfrom
MichalStrehovsky:instsig

Conversation

@MichalStrehovsky

Copy link
Copy Markdown
Member

We left this as NYI but I hit this. The correct implementation for anything that represents a definition should be return this. Since I was looking at this, I'm doing the same for EcmaMethod too since the base MethodDesc.InstantiateSignature does a lot of work for nothing on a definition.

Cc @dotnet/ilc-contrib

We left this as NYI but I hit this. The correct implementation for anything that represents a definition should be `return this`. Since I was looking at this, I'm doing the same for `EcmaMethod` too since the base `MethodDesc.InstantiateSignature` does a lot of work for nothing on a definition.
Copilot AI review requested due to automatic review settings November 25, 2025 11:18
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR implements the InstantiateSignature method on AsyncMethodVariant and EcmaMethod by returning this, which is the correct implementation for method definitions. This replaces a NotImplementedException in AsyncMethodVariant and optimizes EcmaMethod by avoiding unnecessary work in the base implementation.

Key Changes

  • AsyncMethodVariant.InstantiateSignature now returns this instead of throwing NotImplementedException
  • EcmaMethod.InstantiateSignature override added to return this, avoiding unnecessary instantiation logic from the base class

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/coreclr/tools/Common/Compiler/AsyncMethodVariant.cs Replaces throw new NotImplementedException() with return this in InstantiateSignature method
src/coreclr/tools/Common/TypeSystem/Ecma/EcmaMethod.cs Adds InstantiateSignature override that returns this to optimize performance for definition methods

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@MichalStrehovsky

Copy link
Copy Markdown
Member Author

/ba-g failure is #121963

@MichalStrehovsky
MichalStrehovsky merged commit 06d89d2 into dotnet:main Nov 25, 2025
@MichalStrehovsky
MichalStrehovsky deleted the instsig branch November 25, 2025 22:47
@github-actions github-actions Bot locked and limited conversation to collaborators Dec 26, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants