CS8601 and MemberNotNull with ref parameter #7172
-
I have the need to apply "CS8601: Possible null reference assignment" on
CS8601 appears to be telling me that My question is, why does The CS8774 can be resolved by checking the value of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
The compiler doesn't know that If the external library author changes
|
Beta Was this translation helpful? Give feedback.
@brinko99 that's because the
Set
method takes a generic argument and when you set_name
to a not-null value (whichstring.Empty
is), the generic argument becomesstring
, as opposedstring?
. Therefore, theMemberNotNull
is satisfied.