Why does Apex allow this?:

```
Boolean b = false;
if (b = true)
    System.debug('Equal!');
else
    System.debug('Not equal');

```

But flag this with the error 'Condition expression must be of type Boolean':

```
Integer a = 1, b = 2;
if (a = b)
    System.debug('Equal!');
else
    System.debug('Not equal');

```

Assignment within a predicate shouldn't ever be allowed in my view. Why does Apex permit this when the variable is a Boolean?