3 ms·
You original summary is very poorly phrased. You do mention the problem: > By calculating y, he accidentally gives a proof to the compiler that x must be true.
by thaumasiotes 3y ago
You original summary is very poorly phrased. You do mention the problem:
> By calculating y, he accidentally gives a proof to the compiler that x must be true.
But the actual example is written to hide this problem. It should make clear that "y" is actually an expression that depends on x, something like "return x.then_some(x.field)". With that example, it would be immediately clear why evaluating x.field before checking x was a bug.