dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.42k stars 4.76k forks source link

Fix obtaining type handles of IDynamicInterfaceCastableImplementation #109875

Closed MichalStrehovsky closed 6 days ago

MichalStrehovsky commented 1 week ago

Fixes #109496.

We try to optimize away type handles (MethodTables) of types that are only needed due to metadata. Trying to grab type handle of such type throws. This fixes it by unconditionally generating type handles of IDynamicInterfaceCastableImplementation.

Cc @dotnet/ilc-contrib

MichalStrehovsky commented 4 days ago

/backport to release/9.0-staging

github-actions[bot] commented 4 days ago

Started backporting to release/9.0-staging: https://github.com/dotnet/runtime/actions/runs/11888115234