Here is a code I have problem to compile. My question is very simple. How to fix compilation error?
I did try to run this from sbt and from command prompt. SBT configuration below. I did add references to continuation plugin! But looks like this is not helping! See error below.
I've got this from scaladocs: http://www.scala-lang.org/files/archive/api/2.11.8/scala-continuations-library/#scala.util.continuations.package
object MainApp
{
def main(args: Array[String]): Unit =
{
import scala.util.continuations._
val uuidGen : String = "UniqueValue"
def ask(prompt: String): Int @cps[Unit] =
shift {
k: (Int => Unit) => {
val id = uuidGen
printf("%s\nrespond with: submit(0x%x, ...)\n", prompt, id)
}
}
def go =
reset {
println("Welcome!")
val first = ask("Please give me a number")
val second = ask("Please enter another number")
printf("The sum of your numbers is: %d\n", first + second)
}
go
}
}
Sbt configuration for the refrences
name := """scala-testing"""
version := "0.1.0"
scalaVersion := "2.11.2"
autoCompilerPlugins := true
addCompilerPlugin( "org.scala-lang.plugins" % "scala-continuations-plugin_2.11.6" % "1.0.2")
libraryDependencies += "org.scala-lang.plugins" %% "scala-continuations-library" % "1.0.2"
fork in run := true