porFiles5 not a function. This is a method that is something completely different in Scala.
If you have a method, but you need a function, you can use the η extension to raise the method into a function, for example:
someList.foreach(println _)
Scala will also perform η-extension automatically in some cases, if it is completely clear from the context what you mean, for example:
someList.foreach(println)
However, there is ambiguity for parameterless methods, since Scala allows calling without parameters without an argument list, that is, a method defined with an empty parameter list can be called without any argument list:
def foo() = ??? foo
Now, in your case, there is ambiguity: do you want to call porFiles5 or do you mean η-extend it? At the moment, Scala arbitrarily eliminates this situation and performs the η extension, but in future versions this will be a mistake, and you will have to explicitly perform the η extension.
So, to get rid of the warning, just use the explicit η extension instead of the implicit η extension:
timerFunc(porFiles5 _)
source share