The issue with the code:
trace "This is also" // <- This line will not compile
is not that you're somehow importing too many overloaded variants of trace
- it's that you can't use Scala's infix notation this way. An expression like:
e op
is interpreted as a "Postfix Operation" (see section 6.12.2 of the Scala Language Specification), equivalent to the call:
e.op
So your code would be equivalent to:
trace."This is also"
which is of course a compile error.
If you instead use an "Infix Operation" of the form e1 op e2
(section 6.12.3 of the Scala Language Specification), then there aren't any problems even if the method is overloaded:
scala> class Logger { def trace(s: String) = "1arg"; def trace(i: Int, s: String) = "2arg" }
defined class Logger
scala> val log = new Logger
log: Logger = Logger@63ecceb3
scala> log trace "This is also"
res0: String = 1arg