I have a scala worksheet with the following code:
case class Square(width: Double):
val area = width * width
val window = Square(2)
window.area
I am trying to code in IntelliJ Idea, but I am getting the following error:
';' expected but ':' found. case class Square(width: Double):
The code is written in Scala 3, and the IntelliSense is set up correctly and reports no error, but I have a suspicion that the compiler is using some older version of the language. Is this a compiler setup issue and how do I fix it?
Edit: I am following a Scala learning course and downloading my project from there: https://www.coursera.org/learn/effective-scala/supplement/UShnH/scala-3-repl-and-worksheets