hashCode in case classes in Scala

As my professor used to say, only the code tells the truth! So just take a look at the code that is generated for: case class A(i: Int, s: String) We can instruct the Scala compiler to show us the generated code after the different phases, here after the typechecker: % scalac -Xprint:typer test.scala [[syntax … Read more

Should I use the final modifier when declaring case classes?

It is not redundant in the sense that using it does change things. As one would expect, you cannot extend a final case class, but you can extend a non-final one. Why does wartremover suggest that case classes should be final? Well, because extending them isn’t really a very good idea. Consider this: scala> case … Read more

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