The analyzer detected a likely error that has to do with checking if an expression is compatible with one type and casting it to another type inside the body of the conditional statement.
Consider the following example:
if (a instanceof A)
{
return (B)a;
}
The programmer must have made a mistake, since a type conversion like that is very likely to cause a bug. What was actually meant is either to check the expression for type 'B' or cast it to type 'A'.
This is what the correct version could look like:
if (a instanceof B)
{
return (B)a;
}
This diagnostic rule is classified as:
You can look at examples of errors detected by the V6042 diagnostic. |
Was this page helpful?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: