Is there a manner to import a specific method signature?
def test() {
lazy val log = LoggerFactory.getLogger("AndroidProxy")
import log.{error, debug, info, trace}
trace("This is a test")
trace "This is also" // <- This line will not compile
}
Perhaps it's not possible, but my primary goal is to allow this without adding in a new method. I've tried these to no avail
import log.{error => error(_:String)}
import log.{error(x: String) => error(x)}
I suppose the primary challenge is that all of the methods take one argument. I can call no-argument methods without (), and I can create a chain of method calls that omits the .'s e.g. foo getX toString
, but I don't know how to create an arity-1 call automatically
This is a followup to this question.