Roslyn doesn't handle inferred nullability in the presence of goto
.
#39220
Labels
4 - In Review
A fix for the issue is submitted for review.
Area-Compilers
Bug
New Language Feature - Nullable Reference Types
Nullable Reference Types
Milestone
Version Used:
Steps to Reproduce:
Compile and run the following code:
Expected Behavior:
warning CS8602: Dereference of a possibly null reference.
reported forprop.ToString()
Actual Behavior:
No warnings are reported for the program above. The program crashes at runtime with a
NullReferenceException
Notes
If you specify the type of
c
explicitly i.e.C<string?> c = GetC(s);
you'll get the correct warning.The text was updated successfully, but these errors were encountered: