title: Scala: How to force wrapping an integer as an object?
body: <p>I am getting an error here:</p>
  
  <pre><code>val a: Int = 1
  val i: Int with Object = a
  </code></pre>
  
  <p>How can I convert this 1 to an integer object in scala?
  My purpose is to pass it to an <code>Array[Int with Object]</code>.
  It currently displays the error:</p>
  
  <pre><code>error type mismatch
  found : Int(1)
  required: Int with java.lang.Object
         val i: Int with Object = a
                                  ^
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I have this error because I am using an android <a href="https://github.com/android/platform_frameworks_base/blob/master/core/java/android/widget/ArrayAdapter.java" rel="noreferrer"><code>ArrayAdapter</code></a> from scala, and therefore by defining:</p>
  
  <pre><code>class ImageAdapter[T](ctx: Context, viewResourceId: Int, pointers: Array[T]) extends ArrayAdapter[T](ctx, viewResourceId, pointers) { ... }
  </code></pre>
  
  <p>it throws me this error:</p>
  
  <pre><code>overloaded method constructor ArrayAdapter with alternatives: 
  (android.content.Context,Int,java.util.List[T])android.widget.ArrayAdapter[T] &lt;and&gt; 
  (android.content.Context,Int,Array[T with Object])android.widget.ArrayAdapter[T] &lt;and&gt; 
  (android.content.Context,Int,Int)android.widget.ArrayAdapter[T]
     cannot be applied to (android.content.Context,  Int, Array[T])
  </code></pre>
  
  <p>So I need to replace <code>T</code> with <code>T &lt;: Object</code> in <code>class ImageAdapter[T &lt;: Object](ctx: ...</code></p>