Skip to content

Conversation

@davidwrighton
Copy link
Member

  • We need to use IsCanonicalSubtype, not IsSharedByGenericInstantiations as IsSharedByGenericInstantiations returns false for System.__Canon.
  • This caused an issue where shared generic catch did not work correctly for methods which simply attempted to catch T, not a more complex generic type.

Fixes test Regressions\coreclr\GitHub_66005\test66005 under the interpreter

- We need to use IsCanonicalSubtype, not IsSharedByGenericInstantiations as IsSharedByGenericInstantiations returns false for System.__Canon.
- This caused an issue where shared generic catch did not work correctly for methods which simply attempted to catch T, not a more complex generic type.
Copilot AI review requested due to automatic review settings September 23, 2025 17:10
Copy link
Contributor

Copilot AI left a comment

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 fixes a bug in the interpreter's exception handling clause resolution by correcting the method used to determine when to cache type handles. The change replaces IsSharedByGenericInstantiations() with IsCanonicalSubtype() to properly handle shared generic catch clauses.

  • Fixed incorrect method call that was causing shared generic catch blocks to fail
  • Corrected logic for determining when exception handler type handles should be cached

@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Sep 23, 2025
@jkotas jkotas added area-CodeGen-Interpreter-coreclr and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners labels Sep 23, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @BrzVlad, @janvorli, @kg
See info in area-owners.md if you want to be subscribed.

@davidwrighton davidwrighton merged commit c22030a into dotnet:main Sep 23, 2025
101 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 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.

3 participants