title: Value class instantiation?
body: <pre><code>trait IntWrapper[@specialized(Long, Int) T] extends Any { 
    def value: T
    type I = Integral[T]
    implicit def leFromInt(i: Int)(implicit i2: I): T = i2.fromInt(i)
    implicit def leToInt(t: T)(implicit i2: I): Int = i2.toInt(t)
  
    def nums(implicit i: I) = {
      import i._
      @tc def inner(remaind: T, acc: List[Int]): List[Int] = quot(remaind, 10) match {
        case that if equiv(0, that) =&gt; rem(remaind, 10)::acc
        case that =&gt; inner(that, rem(remaind, 10)::acc)
      }
      inner(value, Nil)
    }
  }
  object Test {
    implicit class intw(val value: Int) extends AnyVal with IntWrapper[Int]
    def main(args: Array[String]): Unit = {
      println{
        3.nums
      }
    }
  }
  </code></pre>
  
  <p>Running javap -c Test$ gives</p>
  
  <pre><code>public void main(java.lang.String[]);
        Code:
           0: getstatic     #24                 // Field scala/Predef$.MODULE$:Lscala/Predef$;
           3: new           #26                 // class Test$intw
           6: dup           
           7: aload_0       
           8: iconst_3      
           9: invokevirtual #28                 // Method intw:(I)I
          12: invokespecial #31                 // Method Test$intw."&lt;init&gt;":(I)V
          15: getstatic     #36                 // Field scala/math/Numeric$IntIsIntegral$.MODULE$:Lscala/math/Numeric$IntIsIntegral$;
          18: invokevirtual #40                 // Method Test$intw.nums:(Lscala/math/Integral;)Lscala/collection/immutable/List;
          21: invokevirtual #44                 // Method scala/Predef$.println:(Ljava/lang/Object;)V
          24: return 
  </code></pre>
  
  <p>Given that</p>
  
  <blockquote>
    <p>A value class is actually instantiated when:</p>
    
    <p>a value class is treated as another type. a value class is assigned to
    an array. doing runtime type tests, such as pattern matching.</p>
  </blockquote>
  
  <p>Why is intw instantiated?</p>