Hello DX,
It seems CR reports this false positive:
C#Code Issues
(21,21): info CRR0027: The 'iSomething' expression is not checked for null and can cause System.NullReferenceException
In a case like this:
C#private static void Method(object arg)
{
switch (arg)
{
case ISomething iSomething:
iSomething.DoSomething(); // <-- CR suggest to do a null check here
break;
}
}
Also note the typo in the description of CRR0027 in this table:
https://documentation.devexpress.com/CodeRushForRoslyn/116021/Static-Code-Analysis/Analyzers-Library
Alex
Alex,
Thank you for the report and sample code. I have reproduced the issue locally. Please give us some time to fix it.
Also thanks for noticing the typo in the documentation, we will correct it.