Czar
07/06/2017, 11:15 AM// here Function is: com.google.common.base.Function;
public <T, F> T apply(Function<F, T> function) {
return function.apply((F) this);
}
And when I try to use Kotlin's MyClass().apply { /* set some properties */ }
it does not work, compiler says Type inference failed: Not enough information to infer parameter F in
fun <T : Any!, F : Any!> apply(function: ((input: F?) → T?)!): T!
Please specify it explicitly.
Can I fix this without touching the legacy class? Or am I stuck with using .also {}
as a replacement?