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 GuardedAddBoundTreeForStandaloneSyntax #73262

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

Debug assertion failure in GuardedAddBoundTreeForStandaloneSyntax #73262

sharwell opened this issue Apr 29, 2024 · 0 comments
Assignees
Milestone

Comments

@sharwell
Copy link
Member

sharwell commented Apr 29, 2024

Version Used:

Steps to Reproduce:

While debugging Roslyn with an open instance of Compilers.slnf, I observed the following assertion fail:

Debug.Assert((manager is null && (!IsNullableAnalysisEnabled() || syntax != Root || syntax is TypeSyntax ||
// Supporting attributes is tracked by
// https://github.com/dotnet/roslyn/issues/36066
this is AttributeSemanticModel)) ||
(manager is object && remappedSymbols is object && syntax == Root && IsNullableAnalysisEnabled() && _lazySnapshotManager is null));

It's happening in the evaluation of Binder.DoUncheckedConversion in a speculative semantic model, and appears to impact code where the entire block body of a method is wrapped in unchecked { }. The manager is non-null, but the syntax != Root. Perhaps the assertion should be changed to syntax == GetBindableSyntaxNode(Root)?

@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 29, 2024
@jaredpar jaredpar added Bug and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Apr 29, 2024
@jaredpar jaredpar added this to the 17.11 milestone Apr 29, 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

3 participants