How to use switch/case (simple pattern matching) in Scala?

I suspect the code you are actually using is not FOO, but foo, lowercase, which will cause Scala to just assign the value to foo, instead of comparing the value to it.

In other words:

x match {
  case A => // compare x to A, because of the uppercase
  case b => // assign x to b
  case `b` => // compare x to b, because of the backtick
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)