I got this error defining the function
object test {
val f:AnyVal => String = {
case 10.0 => "10.0"
case _: Double => "Double"
case _: Int => "Int"
case _: Byte => "Byte"
case _ => "anything else"
}
-> Incomplete statements not supported yet, sorry, you’ll have to retype.
However, in REPL it worked just fine.
repat@laptop:~$ scala
Welcome to Scala version 2.10.3 (OpenJDK 64-Bit Server VM, Java 1.6.0_27).
Type in expressions to have them evaluated.
Type :help for more information.
scala> val f:AnyVal => String = {
| case 10.0 => "10.0"
| case _: Double => "Double"
| case _: Int => "Int"
| case _: Byte => "Byte"
| case _ => "anything else"
| }
f: AnyVal => String =
scala>
So aparrently the error is in Eclipse. I use the version 3.7.2. Have you tried turning it off and on again? 😉
