Hello,
I have the following scenario:
interface A
interface B : A
- extension
fun A.foo()
- member
fun foo()
on B bar: B
I wanna call the A.foo
on bar
instead of B#foo
. According to this documentation article, the member function always wins, but I was wondering if there was a way to force the extension function to be called, by using FQN or something like that.
My concrete case is using Redisson in a Kotlin coroutines project. I know there is the kreds library, but it is still very young and not suitable for what I’m working on right now. Redisson uses its RFuture
which derives from Java’s own java.util.concurrent.Future
, for which kotlinx-coroutines-future
provides an await()
extension method.
If it’s utterly impossible to do what I want, I suppose I can use their reactive streams client and use kotlinx-coroutines-reactive
(which from what I can see does not suffer from this conflicting issue), but I’d rather use Redisson’s Future-based client.
Thanks in advance!