Let's say you have
class Program
{
static void Main()
{
bool a = GetFalse();
if (a)
{
a = GetTrue();
}
bool b = GetFalse();
b &= GetTrue();
}
static bool GetFalse() => (false);
static bool GetTrue() => (true);
}
Why will GetTrue()
be executed when b
is already false?
Shouldn't the &=
operator recognize that it can never evaluate to true?