dotnet / dotnet/roslyn

Debug assertion failure in GuardedAddBoundTreeForStandaloneSyntax

Open
#73,262 0 comments 0 reactions 1 assignee Claimed by @333fred View on GitHub
Area-Compilers Bug
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

**Version Used**:

**Steps to Reproduce**:

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

https://github.com/dotnet/roslyn/blob/fa64d902770e1aa9c7aaf89fa0e9dac2f463085c/src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs#L1510-L1514

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)`?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.