Enforce [NotNull]
in method body only upon exit
#42386
Labels
4 - In Review
A fix for the issue is submitted for review.
Area-Compilers
Feature - Nullable Reference Types
Nullable Reference Types
Milestone
Currently, a parameter marked with
[NotNull]
cannot be assigned a maybe-null value (that's a W-warning), ie. we warn on assignment.On the other hand, we only check parameters marked with
[NotNullWhen(...)]
when the method exits.We could use the same method for
[NotNull]
(ie. only check upon exit).Relates to #42348 (comment)
@jaredpar Let me know if you still think we should do this.
The text was updated successfully, but these errors were encountered: