https://kotlinlang.org logo
#announcements
Title
# announcements
f

Fudge

11/19/2019, 10:02 AM
How can I call the
super
method in an overriden extension method?
Copy code
open class Foo {
    open fun Int.bar() {
        println("Bar")
    }
}

class FooImpl : Foo() {
    override fun Int.bar() {
        super.bar() // Unresolved reference
    }
}
In this case, how can I call
Foo#bar
inside
FooImpl#bar
?
🤔 1
w

wasyl

11/19/2019, 10:10 AM
What’s interesting, with this code IDE thinks there’s no recursive call, while in fact there is and this crashes with a stack overflow 😄
i

Ivan Kubyshkin [JetBrains]

11/19/2019, 10:12 AM
f

Fudge

11/19/2019, 10:32 AM
Hmm. Maybe 1.4 will fix this. seems simple enough
i

Ivan Kubyshkin [JetBrains]

11/19/2019, 11:43 AM
@wasyl Thank you! I've created an issue — https://youtrack.jetbrains.com/issue/KT-34982
👍 3
a

Animesh Sahu

11/19/2019, 4:27 PM
Wont this@Foo.bar() help?
🚫 1
2 Views