title: How can I call an overloaded Java varargs method from Scala?
body: <p>I'm trying to call a polymorphic method with both varargs and non varargs versions,</p>
  
  <pre><code>var logger = org.slf4j.LoggerFactory.getLogger("foo")  // 1
  logger.warn.("{}{}{}", 1, 2, 3)                        // 2
  logger.warn.("{}{}{}", Array(1, 2, 3): _*)             // 3
  logger.warn.("{}{}{}", Array(1, 2, 3))                 // 4
  </code></pre>
  
  <p>Line #2 does not compile, giving an “overloaded method value warn with alternatives” error.
  Line #3 does not compile, giving a “no ': _*' annotation allowed here” error.
  Line #4 compiles but invokes the wrong method at runtime, it calls <code>Logger.warn(String,Object)</code> when I need to call <code>Logger.warn(String,Object...)</code>.</p>
  
  <p>How can I call the correct method from Scala?</p>
  
  <p>Compare this Java code</p>
  
  <pre><code>logger.warn("{}-{}-{}", new Integer[] {1, 2, 3});
  // produces 1-2-3
  </code></pre>
  
  <p>With this Scala</p>
  
  <pre><code>logger.warn("{}-{}-{}", Array(1, 2, 3))
  // produces [1, 2, 3]-{}-{}
  </code></pre>