Search code examples
scalaintellij-ideacase-class

why case class ask to override equals()?


I have just started using Intellij on my PC. I created a basic sbt project and init I created a basic case class:

case class Category(cat: String, value: Seq[String])

this asks me to either declare 'Category' as abstract or implement 'equals(that:Any): Boolean' in 'scala.Equals'. I have used case classes before(not on my PC) and was never asked to do so. Why is it asking me this??


Solution

  • Please take a look at: https://intellij-support.jetbrains.com/hc/en-us/community/posts/206638075-error-case-classes-in-scala-doesn-t-need-implement-equal-method

    It seems this is caused by outdated or experimental version of Scala/Java or a combination thereof.