You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The text for rule CS0031 is lovely "Null check can be simplified"
Unfortunately, the fixer text is "Use null propagation" which does not align with the rule name and also differs from how we refer to the feature ("Null-conditional assignment")
It takes a few extra brain cycles to select the correct fixer when it differs from the name of the rule.
"Simplify null check" would align and what I think would be best. "Use null-conditional assignment" would align with the feature name as a second choice.
Languages applicable:
C#
Code example that the analyzer should report:
This issue regards the text when you hover on if in the following code:
publicstaticvoidUpdateAge(Customer?customer,intnewAge){if(customeris not null){customer.Age=newAge;}}
The text was updated successfully, but these errors were encountered:
This has been the text on this feature since it was introduced in 2016. It's widely used, and hasn't seemed to be a problem so far. I would prefer we just keep it as is.
Brief description:
The text for rule CS0031 is lovely "Null check can be simplified"
Unfortunately, the fixer text is "Use null propagation" which does not align with the rule name and also differs from how we refer to the feature ("Null-conditional assignment")
It takes a few extra brain cycles to select the correct fixer when it differs from the name of the rule.
"Simplify null check" would align and what I think would be best. "Use null-conditional assignment" would align with the feature name as a second choice.
Languages applicable:
C#
Code example that the analyzer should report:
This issue regards the text when you hover on
if
in the following code:The text was updated successfully, but these errors were encountered: