Skip to content

Fix nullability crash in deconstruction of type parameter#60200

Merged
jcouv merged 1 commit intodotnet:mainfrom
jcouv:deconstruct-crash
Mar 17, 2022
Merged

Fix nullability crash in deconstruction of type parameter#60200
jcouv merged 1 commit intodotnet:mainfrom
jcouv:deconstruct-crash

Conversation

@jcouv
Copy link
Copy Markdown
Member

@jcouv jcouv commented Mar 16, 2022

Fixes #60187

if (deconstructMethod.OriginalDefinition != deconstructMethod)
{
deconstructMethod = deconstructMethod.OriginalDefinition.AsMember((NamedTypeSymbol)rightResult.Type);
deconstructMethod = (MethodSymbol)AsMemberOfType(rightResult.Type, deconstructMethod);
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 This is what we do for nullability analysis of BoundCall (see ReinferMethodAndVisitArguments)

@ghost ghost added the Area-Compilers label Mar 16, 2022
@jcouv jcouv marked this pull request as ready for review March 16, 2022 21:54
@jcouv jcouv requested a review from a team as a code owner March 16, 2022 21:54
@jcouv jcouv self-assigned this Mar 16, 2022
@jcouv
Copy link
Copy Markdown
Member Author

jcouv commented Mar 17, 2022

@dotnet/roslyn-compiler for second review. Another one line fix

@jcouv jcouv merged commit 294926d into dotnet:main Mar 17, 2022
@jcouv jcouv deleted the deconstruct-crash branch March 17, 2022 17:14
@ghost ghost added this to the Next milestone Mar 17, 2022
@allisonchou allisonchou modified the milestones: Next, 17.2.P3 Mar 28, 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.

Unhandled exception in compilation on deconstruction through generic-constrained interface

4 participants