Why can't the compiler warn against this programming error? : <p>If I write the following code:</p>

<pre><code>int a = 5;
if (a == 1 || a == 1) {
   // do something
}
</code></pre>

<p>Why can't the compiler point out that the second part of the if statement is unnecessary, or warn that the programmer has likely made a mistake?</p>
