```class MyClass { fun String.myFun() { ...
# getting-started
m
Copy code
class MyClass {
    fun String.myFun() {
        myFun() // how to invoke top-level extension function instead of itself?
    }
}

fun String.myFun() {
   ... 
}
j
I would rename one of them to avoid confusion and make things simpler, but you can also add an aliased import statement:
Copy code
package com.foo

import com.foo.myFun as myAliasedFun

class MyClass {
    fun String.myFun() {
        myAliasedFun() 
    }
}


fun String.myFun() {
    println("hello")
}
👍 3
🎩 1