raulraja
04/17/2019, 9:31 AMaltavir
04/17/2019, 10:35 AMfun <A> fetchById(id: Int, with repository: Repository<A>): A? {
return loadById(id)
}
But is does not seem to have a lot of added value on top of
fun <A> Repository<A>.fetchById(id: Int): A? {
return loadById(id)
}
This variant requires explicit receiver in the function call-site, but on the other hand saves a lot of problems with possibly confusing dependency resolution.raulraja
04/17/2019, 3:24 PMaltavir
04/17/2019, 3:25 PMraulraja
04/17/2019, 4:28 PMaltavir
04/17/2019, 4:33 PMExtensions functions as they are today are effectively implicit arguments no matter what we call them.No, they are not. Extension receivers are explicit in the call site. The main difference of your proposal from KEEP-176 is the implicit context resolution. KEEP-176 forces to explicitly define all receiver objects at the call site (while you try to infer them at use site).