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 crash with Dispose method with params #75305

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jcouv
Copy link
Member

@jcouv jcouv commented Sep 30, 2024

Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/2187060

The issue is in OverloadResolution.AddMemberToCandidateSet which may or may not compute a normal result (normalResult) on line 1047, then decides whether to keep the normal or expanded result on line 1079 (PreferExpandedFormOverNormalForm).
In the failing scenario, we skip computing a normal result but end up preferring the normal result (which is default) which then would crash in OverloadResolutionResult.ReportDiagnostics (assertion in debug mode in AssertNone(MemberResolutionKind.None) and throwing UnexpectedValue at line 457 in release mode).
The fix is to prefer the expanded result since we didn't compute a normal result.

@jcouv jcouv self-assigned this Sep 30, 2024
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Issues and PRs which have not yet been triaged by a lead label Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant