Is it possible to simplify the following match statement using @ syntax?
foo match {
case f: Foo => y(f)
case f if forceY => y(f)
case _ => x
}
where forceY is a boolean.
I've tried the following but getting compile errors and it does look like possibly questionable syntax for the compiler to interpret. Perhaps this is impossible to express?
foo match {
case f @(_: Foo | _ if forceY) => y(f)
case _ => x
}