I do not agree that he really needs a warning. The main problem is that this code is potentially legitimate, and if in this case you have to explicitly disable the warning.
What I mean, in general, when you get a warning, you can change your code to get rid of the warning (and presumably make the code better at the same time). But in this case, it is possible that you did it as it was intentionally and could not change your code to get rid of the warning.
For example, the warning “unreachable code” is that you can simply delete the unreachable code to get rid of the warning. Or the warning “could not find the link” is usually a signal that you will get errors like undefined, but if not, you can just delete the link. Or maybe the warning “Previous catch exception has not catch all exceptions”: in this case you need to change your code so that either the new sentence comes before catch-all, or even removes catch.
But the fact is that in each case, when you receive a warning, you must change your code, and making changes will always lead to a "better" code. However, in the case of this question, the call is not ambiguous (as far as the compiler is concerned), and I do not think that you can say that it was always a mistake to write such code, so there should not be a warning.
If the compiler gives a warning about every case when you do something that is probably not the best idea, then we will be awash with warnings!
Dean harding
source share