title: How to pass a raw type in Scala?
body: <p>How can I pass a parameter to a Java method with a raw type in its method signature?  My example API is as follows:</p>
  
  <pre><code>class P&lt;T&gt; {}
  
  class Q {
      public void f(P p[]) {}
  }
  </code></pre>
  
  <p>And my attempt to call it from Scala looks like this:</p>
  
  <pre><code>val q = new Q()
  val p = new P()
  val p_array = Array(p)
  q.f(p_array)
  </code></pre>
  
  <p>Which generates the following compiler error:</p>
  
  <pre><code>type mismatch;
  found   : Array[P[Nothing]]
  required: Array[P[_]]
  q.f(p_array)
  </code></pre>
  
  <p>Parameterizing p as type P[Any] doesn't help either.  I'm using 2.8 RC6.</p>
  
  <p>By way of background, the API which has caused me this problem is something called <a href="http://teleal.org/projects/cling/core/apidocs/org/teleal/cling/model/meta/LocalDevice.html" rel="nofollow noreferrer">org.teleal.cling.model.meta.LocalDevice</a>  The constructor looks like it takes a parameterized argument 'deviceServices'.  However, the type parameter 'LocalService' <em>also</em>
  takes a parameter, not supplied, resulting in the awkward method signature.</p>