fork download
  1. object Main{
  2. def doSomething(l : MyList, i : Int):MyList = {
  3. l match {
  4. case Nil() => Nil()
  5. case Cons(e,tail) if e > i => Cons(e,doSomething(tail,i))
  6. case Cons(e,tail) => doSomething(tail,i)
  7. }
  8. }
  9.  
  10. def main(args: Array[String]) {
  11. }
  12. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.scala:2: error: not found: type MyList
def doSomething(l : MyList, i : Int):MyList = {
                                     ^
Main.scala:2: error: not found: type MyList
def doSomething(l : MyList, i : Int):MyList = {
                    ^
Main.scala:4: error: object Nil is not a case class constructor, nor does it have an unapply/unapplySeq method
        case Nil() => Nil()
             ^
Main.scala:4: error: not enough arguments for method apply: (n: Int)Nothing in trait LinearSeqOptimized.
Unspecified value parameter n.
        case Nil() => Nil()
                         ^
Main.scala:5: error: not found: value Cons
        case Cons(e,tail) if e > i => Cons(e,doSomething(tail,i))
             ^
Main.scala:5: error: not found: value e
        case Cons(e,tail) if e > i => Cons(e,doSomething(tail,i))
                             ^
Main.scala:5: error: not found: value Cons
        case Cons(e,tail) if e > i => Cons(e,doSomething(tail,i))
                                      ^
Main.scala:6: error: not found: value Cons
        case Cons(e,tail)    => doSomething(tail,i)
             ^
Main.scala:6: error: not found: value tail
        case Cons(e,tail)    => doSomething(tail,i)
                                            ^
9 errors found
stdout
Standard output is empty