In my Play 2.0 application I have the following match expression:
@item.level match {
case 0 => {?}
case 1 => {Beginner}
case 2 => {Medium}
case 3 => {Expert}
}
But I get the error message
')' expected but 'case' found.
pointing to the last curly brace.
What’s wrong here? It looks pretty much like in the documentation.
This should work
You need the outer
{}to indicate that the whole thing is one Scala expression. I assume that the cases have strings that you want to output. In that case you have to quote them. If they are identifiers, your syntax would be correct, but then you don’t need the{}there.