Why would a Scala Worksheet using Scala-IDE give this as an error?
Asked Answered
T

1

2

In a Scala worksheet I can do this:

object Play {

 println("Playing a bit")                         //> Playing a bit

 case class X(a: Int = 1, x: List[X]){
 }

}

but I can't do this:

object Play {

 case class X(a: Int = 1, x: List[X]){
 }

}

In the latter it will complain after the case class that ; was expected but import found

Tymon answered 27/9, 2012 at 7:10 Comment(3)
I'm guessing because Worksheet is very new and contains bugs...Mandal
Thanks Luigi, you are probably right.Tymon
Hi @LuigiPlinge, will you put your comment as answer please. This is not a problem with the latest nightly's so you are spot on.Tymon
M
1

This seems to be a bug that is fixed in the latest nightly build of Scala IDE. See https://mcmap.net/q/2036848/-classes-in-worksheet-in-scala-ide-cause-error

Mandal answered 8/10, 2012 at 13:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.