Missing nullability warnings for semi-autoproperties #76487
Labels
Area-Compilers
Feature - Field Keyword
untriaged
Issues and PRs which have not yet been triaged by a lead
Version Used:
Steps to Reproduce:
Compile and run the following code (sharplab.io)
Expected Behavior:
A warning is emitted for
get;
accessor that returns a possibly nullable field value as a result of a non-nullable propertyActual Behavior:
No warnings at all in the program above. It crashes with a
NullReferenceException
at runtimeNotes:
If you explicitly implement
get;
with the equivalentget => field;
you get the correctCS8603: Possible null reference return.
warningThe text was updated successfully, but these errors were encountered: