Skip to content
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

Fix mapping of redeclared type parameters #3167

Closed
wants to merge 2 commits into from

Conversation

sbomer
Copy link
Member

@sbomer sbomer commented Dec 21, 2022

We were skipping the type parameter mapping of compiler-generated types whose only generic parameters were those implicitly created for the declaring type's type parameters.

For the testcase in question, the nested state machine inherited a generic parameter from the display class. This was causing unnecessary warnings in a field assignment that assigned this (an instance of the display class) to a field on the state machine. In IL, that assignment references a field type like DisplayClass<T> where T is the generic parameter on the state machine. Here we were properly mapping type parameters of the display class back to the annotated enclosing method's type parameters, so we could tell that the "target" required PublicMethods. But the substituted T from the state machine was not mapped, causing the mismatch.

Fixes the issue mentioned in dotnet/roslyn#46646 (comment).

@marek-safar
Copy link
Contributor

@sbomer what is the plan with this PR?

@sbomer
Copy link
Member Author

sbomer commented May 16, 2023

Moved to dotnet/runtime#86353

@sbomer sbomer closed this May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants