title: Scala - ambiguous reference to overloaded definition -- with varargs
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/3313929/how-do-i-disambiguate-in-scala-between-methods-with-vararg-and-without">How do I disambiguate in Scala between methods with vararg and without</a>  </p>
  </blockquote>
  
  
  
  <p>I am currently porting part of an application to scala and it uses the Oval library.  The method is question is the Validator.validate method.  It has <a href="http://oval.sourceforge.net/api/net/sf/oval/Validator.html#validate%28java.lang.Object%29" rel="noreferrer">two</a> <a href="http://oval.sourceforge.net/api/net/sf/oval/Validator.html#validate%28java.lang.Object,%20java.lang.String...%29" rel="noreferrer">signatures</a>:</p>
  
  <pre><code>List&lt;ConstraintViolation&gt; validate(Object validatedObject)
  List&lt;ConstraintViolation&gt; validate(Object validatedObject, String... profiles) 
  </code></pre>
  
  <p>The scala code looks generally like this:</p>
  
  <pre><code>def validate(toValidate: AnyRef) = {
    val validator = createValidator
    validator.validate(toValidate)
  }
  </code></pre>
  
  <p>And the error message:</p>
  
  <pre><code>error: ambiguous reference to overloaded definition,
  [INFO] both method validate in class Validator of type (x$1: Any,x$2: &lt;repeated...&gt;[java.lang.String])java.util.List[net.sf.oval.ConstraintViolation]
  [INFO] and  method validate in class Validator of type (x$1: Any)java.util.List[net.sf.oval.ConstraintViolation]
  [INFO] match argument types (AnyRef)
  [INFO]       this.validator.validate(toValidate)
  </code></pre>
  
  <p>How can I get this be be unambiguous?</p>