Lucky hour! Grab a free trial license — offer ends in 00:59:58. Claim now
The analyzer has detected two functions with identical implementations. Although having two identical functions is not an error, they should still be reviewed.
The diagnostic rule detects the following error types:
class Point
{
foo;
bar;
getFoo() { return foo; }
getBar() { return foo; }
}
A typo causes two logically different functions to perform the same actions.
The fixed code:
class Point
{
foo;
bar;
getFoo() { return foo; }
getBar() { return bar; }
}
In the example, the identical bodies of the getFoo and getBar functions indicate an error. However, issuing warnings for all identical functions could result in many false positives. Therefore, the analyzer has a number of exceptions where a warning about identical function bodies is not required.
Some examples of exceptions:
this, for example, isXYZ() { return true; };throw statement.You can look at examples of errors detected by the V7002 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: