TIL that you can't perform an assignment in the second branch of a ternary operator because ternary has higher precedence than assignment.
On a related note, I'm pretty happy with how my toy C compiler reports errors now—it almost looks like GCC and Clang, at least for these simple cases.