dotnet / dotnet/roslyn

Assert fails in NullableWalker with (invalid) statement block in assignment

Open
#75,412 0 comments 0 reactions 0 assignees View on GitHub
Area-Compilers Bug Feature - Nullable Reference Types
Dominant language
C#
Stars
20.7k
Forks
4.3k
PR merge metrics
PR metrics pending

Description

roslyn version 405a8fa923a7b11fd4645ecdd092fb1123a4865a

```cs
[Fact]
public void Block()
{
var source = """
#nullable enable
string s = {"y"}"x";
""";
CreateCompilation(source).VerifyDiagnostics();
}
```

> System.InvalidOperationException : Analyzed 6 nodes in NullableWalker, but DebugVerifier expects 4. Example of unverified node: BoundLiteral "y"
> Stack Trace:
> src\Compilers\CSharp\Portable\FlowAnalysis\NullableWalker.DebugVerifier.cs(50,0): at Microsoft.CodeAnalysis.CSharp.NullableWalker.DebugVerifier.Verify(ImmutableDictionary`2 analyzedNullabilityMap, SnapshotManager snapshotManagerOpt, BoundNode node)

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.