'How does a missing boolean operator still compile?

I have code like this:

val pop: Bool = (
  (fsm === Fsm.None && canPop) ||
  (fsm === Fsm.Some && canPop && fooBar)
  (fsm === Fsm.Other && canPop && dragonFruit) ||
  (fsm === Fsm.Mom && canPop))

fsm is a ChiselEnum based state machine and the other signals are just Bools. There is a missing || on the second statement line (after fooBar). This compiles and runs, although causes a bug in the behavior. My question is... why does this compile? This doesn't seem like valid syntax. Is it?

Please help me understand this. I just spent numerous days debugging a large circuit to find this issue.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source