Nullable false positives when boolean conditional is first assigned to a named variable #52717
Labels
Area-Compilers
Resolution-By Design
The behavior reported in the issue matches the current design
untriaged
Issues and PRs which have not yet been triaged by a lead
Version Used: Microsoft.Net.Compilers.Toolset v3.9.0, or VS/MSBuild 16.9.4
Steps to Reproduce:
Expected Behavior:
The compiler should know that
value
cannot be null in theelse
block, just as it knows that when not using a variable.Actual Behavior:
CS8602 warning upon calling value.ToString()
Similar behavior with other nullable-related errors if I try to pass the value as an argument, assign it to a field, etc.
The text was updated successfully, but these errors were encountered: