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 DeclaringCompilation for source methods #59278

Closed
wants to merge 1 commit into from

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Feb 4, 2022

Fixes #58198

The problem:
Symbol.DeclaringCompilation relies on ContainingModule/ContainingSymbol to get the declaring compilation. But for lambdas in an EE scenario the containing symbol may be from PE. So in such scenarios, we'd get a null declaring compilation.
This breaks SourceMethodSymbolWithAttributes which uses several calls to DeclaringCompilation.GetWellKnownType(...).

Relates to #59069 (recent related fix) and #59111 (follow-up issue about definite assignment)

@jcouv jcouv self-assigned this Feb 4, 2022
@jcouv jcouv force-pushed the declaring-compilation branch from cd2a80b to 46b203e Compare February 4, 2022 19:17
@jcouv jcouv marked this pull request as ready for review February 4, 2022 21:07
@jcouv jcouv requested a review from a team as a code owner February 4, 2022 21:07
@jcouv
Copy link
Member Author

jcouv commented Feb 4, 2022

@AlekseyTs Chuck mentioned that you discussed a similar issue last week. Let me know what you think.
@dotnet/roslyn-compiler for review.

@AlekseyTs
Copy link
Contributor

@jcouv

Let me know what you think.

Let's discuss offline next week.

@jcouv
Copy link
Member Author

jcouv commented Feb 11, 2022

Closing in favor of a more systematic EE-side solution (avoiding source symbols being parented to PE symbols). Tracked by #59093 (comment)

@jcouv jcouv closed this Feb 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing expression compiler tests involving async lambdas
2 participants