I was hitting the same problem. Enclosing the right part of the case in curly braces fixed the issue for me.
This works for me:
@user match {
case Some(user) => { Welcome, @user.username! }
case None => { <a href="https://stackoverflow.com/questions/9748258/@routes.Application.login">Login</a> }
}
Without the braces, it gave an error with the space after the { on the match line highlighted. “‘case’ expected but identifier found.”
I also gives me that error if I try to put an @ before the opening curly brace like this:
//This gives me the same error
@user match {
case Some(user) => @{ "Welcome, " + user.username + "!" }
case None => { <a href="https://stackoverflow.com/questions/9748258/@routes.Application.login">Login</a> }
}