Fixing scala error “error: recursive value count needs type”
If you try to define a recursive function without a type, you will get this error: error: recursive value count needs type For example, note how this “count” value doesn’t have a type: val count = (values: Seq[Any]) => { values.headOption match { case Some(_) => 1 + count(values.tail) case None => 0 } } …
Continue reading “Fixing scala error “error: recursive value count needs type””