Uh oh!
There was an error while loading. Please reload this page.
Fix type parameter mapping logic in ILLink/ILCompiler - #92088
Conversation
ghost
commented
Sep 15, 2023
Tagging subscribers to this area: @agocke, @sbomer, @vitek-karas Issue DetailsThe compiler-generated code for This case was missing from the compiler-generated type parameter mapping logic. We need to discover the substituted generic typeref for the outer closure environment from the Fixes #91880.
|
agocke
left a comment
There was a problem hiding this comment.
LGTM, I didn't anticipate that we could have only a ldsfld to the target, and no stsfld from the outside. But it looks like that's the case, so we need to track both loads and stores.
sbomer
commented
Sep 15, 2023
/backport to release/8.0 |
Started backporting to release/8.0: https://github.com/dotnet/runtime/actions/runs/6201152053 |
The compiler-generated code for
Container<T>in this testcase contains two closure types, one for each lambda in the expression(Func<T, T> x) => v => x(x(v));. The outer closure environment type is instantiated by its cctor, which stores an instance into a static field. It is never directly instantiated from another type - instead, the cctor is triggered when the cctor ofContainer<T>access this static field.This case was missing from the compiler-generated type parameter mapping logic. We need to discover the substituted generic typeref for the outer closure environment from the
ldsfld.Fixes#91880.