Hi!
I would like to pass path.toFile()::readText
to a function which accepts () -> String
.
The problem is that the readText()
method has a parameter named charset
. Then the function looks like (Charset) -> String
. It works that way but I assumed that the charset
can be omitted because it is a default parameter.
The two workarounds are:
- (as already explained) change the signature of the method that accepts the function to
(Charset) -> String
- write it as a lambda: `{ path.toFile().readText() }
But path.toFile()::readText
to () -> String
is not possible.
Any ideas?