Hey guys, does anybody know how to use the fully q...
# announcements
g
Hey guys, does anybody know how to use the fully qualified name to an extension function? eg
Copy code
package asdf

fun Any.doThing() = TODO()

//...
package main

//no import statements

fun outer(){
  42.doThing() //<-- auto import `asdf.dothing`? 
  //No! I want to write the fully-qualified invocation instead!

  asdf.doThing(42) //error
  42.asdf.doThing() //error
  42.`asdf.doThing`() //error
}
b
why make it an extension function then?
s
Don’t believe this is possible though would need someone from JB to confirm
r
As far as I know, you can't do it. It's related to the issue where you can't call
super
of an overridden extension function in a class.
g
why make it an extension function then?
IntelliJ Live templates. I remember reading that live templates you were supposed to fully qualify everything and let the user + IDE alt-enter to import things as appropriate. Its not really a big deal, it just means my live-template generates code that doesnt compile until a few more alt-enter's.
l
You can use an import alias (
import package.stuff as thing
)