Scala literal identifiers (backticks) on for loops

Backticks make it into a pattern to be matched against the value, like

val x = 7

9 match {
   case `x` => "only matches the number seven"
   case x => x.toString
}
1 Like