I have a legacy class hierarchy whose parent have ...
# announcements
c
I have a legacy class hierarchy whose parent have following method:
Copy code
// 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
Copy code
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?