fork download
  1. object Main extends Application {
  2. implicit def safeCast[X,Y, _ >: X <: Y]( x:X ):Y = x.asInstanceOf[Y]
  3. case class L[X](val x: X) { def double[_ >: X <: Int] = x*2 }
  4.  
  5. override def main(args: Array[String]) = {
  6. println(L(42).double)
  7. }
  8. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.scala:3: error: value * is not a member of type parameter X
    case class L[X](val x: X) { def double[_ >: X <: Int] = x*2 }
                                                             ^
one error found
spoj: The program compiled successfully, but Main.class was not found.
      Class Main should contain method: def main(args: Array[String]).
stdout
Standard output is empty