User2403
User2403

Reputation: 185

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??

Upvotes: 0

Views: 453

Answers (1)

Dennis Hunziker
Dennis Hunziker

Reputation: 1293

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.

Upvotes: 4

Related Questions