This is because he cannot determine which atoi to use. There are two possibilities parseInt (String) and parseInt (String, int). From REPL:
scala> atoi <console>:7: error: ambiguous reference to overloaded definition, both method parseInt in object Integer of type (x$1: java.lang.String)Int and method parseInt in object Integer of type (x$1: java.lang.String,x$2: Int)Int match expected type ? atoi
You need to say specifically which one to use, this will work:
println((args map ( atoi(_))).foldLeft(0)(_ + _));
Matthew farwell
source share