-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Missing nullable warning in generic methods #35602
Copy link
Copy link
Closed
Labels
Area-CompilersBugConcept-Diagnostic ClarityThe issues deals with the ease of understanding of errors and warnings.The issues deals with the ease of understanding of errors and warnings.Feature - Nullable Reference TypesNullable Reference TypesNullable Reference TypesResolution-By DesignThe behavior reported in the issue matches the current designThe behavior reported in the issue matches the current design
Milestone
Metadata
Metadata
Assignees
Labels
Area-CompilersBugConcept-Diagnostic ClarityThe issues deals with the ease of understanding of errors and warnings.The issues deals with the ease of understanding of errors and warnings.Feature - Nullable Reference TypesNullable Reference TypesNullable Reference TypesResolution-By DesignThe behavior reported in the issue matches the current designThe behavior reported in the issue matches the current design
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Active/Investigating
Version Used:
Microsoft.Net.Tool@3.1.0-beta3-final
Steps to Reproduce:
Expected Behavior:
possibleNullValue.possibleNullValueasking to return a nullable.Actual Behavior:
I only have a "possible null reference" warning on the last
Check(value)(in the generic method). In fact I don't think the compiler really knowspossibleNullValuecan really be null so it looks like a bug to me (even if the warning is totally valid).Adding the code error here so that people don't have to open the .zip:
[jcouv updated:]
I think we've narrowed down to the most questionable/suspicious scenario:
(see on sharplab)