problem compiling a switch case statement in chisel

I was writing a simple switch-case for my state machine. However, after calling sbt test I receive the following error:

enter image description here


It's very important to include the version of Chisel and your code when asking a question, but fortunately this one rings a bell as https://github.com/chipsalliance/chisel3/pull/1595.

You can workaround this by importing chisel3.util._. The better solution would be to update your version of Chisel, this bug is fixed in versions v3.2.8, v3.3.3, and v3.4.0 (and newer).