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

Debug assertion failure in MethodSymbol.AsMember when called from Binder.UnwrapCollectionExpressionIfNullable #73181

Open
sharwell opened this issue Apr 22, 2024 · 0 comments

Comments

@sharwell
Copy link
Member

sharwell commented Apr 22, 2024

MethodSymbol.AsMember assumes that the newOwner is not an error symbol. This can fail (cause a debug assertion) for the following caller:

nullableValueGetter = nullableValueGetter.AsMember((NamedTypeSymbol)collectionExprType);

It seems like it should be sufficient to modify the following condition to also not take any action when collectionExprType is an error type:

if ((object)collectionExprType != null && collectionExprType.IsNullableType())

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 22, 2024
@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 22, 2024
@jaredpar jaredpar added this to the Backlog milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants