-
Notifications
You must be signed in to change notification settings - Fork 128
Map type parameters for static closures #2899
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
Conversation
- For a static closure shared by multiple methods - Run existing tests in Release mode too
Co-authored-by: Vitek Karas <[email protected]>
- Rename variable
|
Sorry, not sure I'm fully following the change. How does it prevent a sample like https://sharplab.io/#v2:D4AQTAjAsAUCDMACciDCAeAKgPkQb1kSMUOIWQBZEBZACgEp9TiyBWLXAMwkQF5EGfXABMAppwCGAVwA2AF1qZ6AbmYtk7HIk5g+AxrxHjp8xSrUBfWBaA== from producing a lot of warnings or failing? Since there's two constructor calls to a single type. |
agocke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it looks like my case always goes through static fields. LGTM
This discovers type parameter mappings between generic type parameters and static closures which reference them. It detects the closure environment by scanning for stsfld instructions which reference generic closure types. There may be multiple methods associated with the same static closure, so this case doesn't produce warnings. This also fixes an unrelated issue where in Release mode, the compiler can generate struct closure environments that will never get instantiated via a ctor call. A new testcase runs the CompilerGeneratedTypes tests in Release mode to cover this. Commit migrated from dotnet/linker@b883ec2
Fixes #2826
This also fixes an unrelated issue I discovered where in
Releasemode, the compiler can generate struct closure environments that will never get instantiated via a ctor call. I added a testcase that runs the CompilerGeneratedTypes tests in Release mode to cover this.