Hello, may I ask the reason why referring to a fun...
# getting-started
l
Hello, may I ask the reason why referring to a function which is both member and extension is prohibited? On JVM all the top level functions are compiled into the same class, so they're all members effectively, but these top level extensions are referable. 🤔
c
Can you give a short example of what you're trying to do and doesn't work? Preferably using the playground: https://play.kotlinlang.org
l
No, I'm just curious.
Copy code
class A {
    fun A.a() {
        ::a // Error
    }
}
c
That's interesting 🤔 I have no idea
e
that needs both
this@A
and
this@a
receivers
c
Oh I see! It's because they could be different objects, so it's ambiguous which one's the reference would give