Ivan Pavlov
11/27/2020, 11:38 AMfun interface with lambdas (class D) doesn't work? I'd really want to use delegation that way, not like class C
fun interface A {
fun f()
}
fun interface B {
fun f()
}
class C(b: B) : A by A(b::f) //works
class D(b: B) : A by { b.f() } //doesn't workVampire
11/27/2020, 2:27 PMclass D(b: B) : A by { b.f() } as Aephemient
11/27/2020, 3:00 PMclass D(b: B) : A by (A { b.f() })Ivan Pavlov
11/27/2020, 3:04 PMfun for interface A it still compiles which is not a good option I thinkIvan Pavlov
11/27/2020, 3:08 PMclass C. I can also use by A({ b.f() }) but my question is why { b.f() } doesn't work? I mean, it's intentional behavior or it's just compiler not as smart as I want? 🙂ephemient
11/27/2020, 3:10 PM