Why does Scala REPL crash "error:") "expected but string literal found" for string interpolation?

Well, I'm basically trying to do this in my ubuntu 14.04:

scala> val test="Hello!"
test: java.lang.String = Hello!
scala>println(s"The message is $test")

and I get the error:

<console>:1: error: ')' expected but string literal found.
   println(s"The message is $test")
            ^

It should work, as I have done some research, and it says here that this is the correct form. So what am I doing wrong?

+4
source share

All Articles