Hi there! Could you tell me how to fix the follow...
# random
n
Hi there! Could you tell me how to fix the following code?
Copy code
interface A
interface B
class C: A, B
fun <T> foo(t: T) where T:A, T:B {}
fun <T> T.bar() where T:A, T:B {}
foo(C())  // OK
C().bar() // Compilation error!!!
try.kotlinlang.org said "Error:(13, 5) Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: local final fun <T : A> C.bar(): kotlin.Unit where T : B defined in main"