Moved adapt from valium to miniboxing

Awesome work @xeno-by, only 10 tests failing. Main 2 problems are in these 2 tests:
 * https://github.com/miniboxing/miniboxing-plugin/blob/wip/tests/correctness/src/miniboxing/tests/compile/mb_erasure_torture8.scala
 * https://github.com/miniboxing/miniboxing-plugin/blob/wip/tests/correctness/src/miniboxing/tests/compile/mb_signatures.scala
```
Compiling gh-bug-1.scala                                               ... [ OK ]
Compiling gh-bug-11.scala                                              ... [ OK ]
Compiling gh-bug-18-nested-class-override-1.scala                      ... [ OK ]
Compiling gh-bug-18-nested-class-override-2.scala                      ... [ OK ]
Compiling gh-bug-2.scala                                               ... [ OK ]
Compiling gh-bug-3.scala                                               ... [ OK ]
Compiling gh-bug-36.scala                                              ... [ OK ]
Compiling gh-bug-4.scala                                               ... [ OK ]
Compiling gh-bug-53-1.scala                                            ... [ OK ]
Compiling gh-bug-53-2.scala                                            ... [ OK ]
Compiling gh-bug-53-3.scala                                            ... [ OK ]
Compiling gh-bug-55.scala                                              ... [ OK ]
Compiling gh-bug-60.scala                                              ... [ OK ]
Compiling gh-bug-61.scala                                              ... [ OK ]
Compiling gh-bug-7.scala                                               ... [ OK ]
Compiling gh-bug-8.scala                                               ... [ OK ]
Compiling gh-bug-9.scala                                               ... [ OK ]
Compiling mb_any_methods.scala                                         ... [ OK ]
Compiling mb_array_ops.scala                                           ... [ OK ]
Compiling mb_benchmarks_array_base.scala                               ... [ OK ]
Compiling mb_benchmarks_array_separate_base.scala                      ... [ OK ]
Compiling mb_benchmarks_array_separate_compilation.scala               ... [ OK ]
Compiling mb_benchmarks_list.scala                                     ... [ OK ]
Compiling mb_breeze_1.scala                                            ... [ OK ]
Compiling mb_breeze_2.scala                                            ... [ OK ]
Compiling mb_breeze_3.scala                                            ... [ OK ]
Compiling mb_duplicator_tpar_si_7626.scala                             ... [ OK ]
Compiling mb_erasure_torture1.scala                                    ... [ OK ]
Compiling mb_erasure_torture2.scala                                    ... [ OK ]
Compiling mb_erasure_torture3.scala                                    ... [ OK ]
Compiling mb_erasure_torture4.scala                                    ... [ OK ]
Compiling mb_erasure_torture5.scala                                    ... [ OK ]
Compiling mb_erasure_torture6.scala                                    ... [ OK ]
Compiling mb_erasure_torture7.scala                                    ... [ OK ]
Compiling mb_erasure_torture8.scala                                    ... [FAIL]
Diff:
--- output
+++ expected
@@ -18,5 +18,5 @@
     def foo_J(T_TypeTag: Byte, c: Long, cond: Boolean): Any = {
       scala.this.Predef.println("hello");
-      c;
+      MiniboxConversions.this.minibox2box[Tsp](c, T_TypeTag);
       scala.this.Predef.println("world");
       MiniboxConversions.this.minibox2box[Tsp](c, T_TypeTag)

Compiling mb_inheritance_parents_complex.scala                         ... [ OK ]
Compiling mb_inheritance_parents_first.scala                           ... [ OK ]
Compiling mb_inheritance_parents_generic.scala                         ... [ OK ]
Compiling mb_inheritance_parents_partial1.scala                        ... [ OK ]
Compiling mb_inheritance_parents_partial2.scala                        ... [ OK ]
Compiling mb_inheritance_parents_second.scala                          ... [ OK ]
Compiling mb_inheritance_parents_third.scala                           ... [ OK ]
Compiling mb_inheritance_parents_trait_first.scala                     ... [ OK ]
Compiling mb_inheritance_parents_trait_second.scala                    ... [ OK ]
Compiling mb_library_5.scala                                           ... [FAIL]
Diff:
--- output
+++ expected
@@ -1,3 +1,5 @@
 [Now checking: minibox-dupl]
+newSource1.scala:13: error: reassignment to val
+    private var hd: A = _
+                ^
 [Not checkable: minibox-adapt]
-[Now checking: minibox-spec]

Compiling mb_library_6.scala                                           ... [ OK ]
Compiling mb_library_7_1.scala                                         ... [ OK ]
Compiling mb_library_7_2.scala                                         ... [ OK ]
Compiling mb_library_8.scala                                           ... [ OK ]
Compiling mb_locals.scala                                              ... [ OK ]
Compiling mb_nested_class_fifth.scala                                  ... [FAIL]
Diff:
--- output
+++ expected
@@ -28,68 +28,5 @@

 [Now checking: minibox-dupl]
-[[syntax trees at end of              minibox-spec]] // newSource1.scala
-package miniboxing.tests.compile.nested {
-  abstract trait CCCCC[@miniboxed T >: Nothing <: Any] extends Object {
-    def test(): Unit;
-    def test_J(T_TypeTag: Byte): Unit
-  };
-  class CCCCC_J[Tsp >: Nothing <: Any] extends Object with miniboxing.tests.compile.nested.CCCCC[Tsp] {
-    def <init>(miniboxing|tests|compile|nested|CCCCC_J|T_TypeTag: Byte, c: Long): miniboxing.tests.compile.nested.CCCCC_J[Tsp] = {
-      CCCCC_J.super.<init>();
-      ()
-    };
-    def test(): Unit = CCCCC_J.this.test_J(CCCCC_J.this.miniboxing|tests|compile|nested|CCCCC_J|T_TypeTag);
-    def test_J(T_TypeTag: Byte): Unit = {
-      class DDDDD[U >: Nothing <: Any] extends Object {
-        <paramaccessor> private[this] val d: U = _;
-        def <init>(d: U): DDDDD[U] = {
-          DDDDD.super.<init>();
-          ()
-        };
-        private[this] val x1: Long = CCCCC_J.this.c;
-        <stable> <accessor> def x1(): Long = DDDDD.this.x1;
-        private[this] val x2: U = DDDDD.this.d;
-        <stable> <accessor> def x2(): U = DDDDD.this.x2;
-        def foo(): Unit = {
-          val x3: Long = CCCCC_J.this.c;
-          val x4: U = DDDDD.this.d;
-          scala.this.Predef.println(MiniboxDispatch.this.mboxed_eqeq_other(DDDDD.this.x1(), T_TypeTag, DDDDD.this.x2()));
-          scala.this.Predef.println(MiniboxDispatch.this.mboxed_eqeq_other(x3, T_TypeTag, x4))
-        }
-      };
-      new DDDDD[Tsp](MiniboxConversions.this.minibox2box[Tsp](CCCCC_J.this.c, T_TypeTag)).foo()
-    };
-    <paramaccessor> private[this] val c: Long = _;
-    <paramaccessor> private[this] val miniboxing|tests|compile|nested|CCCCC_J|T_TypeTag: Byte = _
-  };
-  class CCCCC_L[Tsp >: Nothing <: Any] extends Object with miniboxing.tests.compile.nested.CCCCC[Tsp] {
-    def <init>(c: Tsp): miniboxing.tests.compile.nested.CCCCC_L[Tsp] = {
-      CCCCC_L.super.<init>();
-      ()
-    };
-    def test(): Unit = {
-      class DDDDD[U >: Nothing <: Any] extends Object {
-        <paramaccessor> private[this] val d: U = _;
-        def <init>(d: U): DDDDD[U] = {
-          DDDDD.super.<init>();
-          ()
-        };
-        private[this] val x1: Tsp = CCCCC_L.this.c;
-        <stable> <accessor> def x1(): Tsp = DDDDD.this.x1;
-        private[this] val x2: U = DDDDD.this.d;
-        <stable> <accessor> def x2(): U = DDDDD.this.x2;
-        def foo(): Unit = {
-          val x3: Tsp = CCCCC_L.this.c;
-          val x4: U = DDDDD.this.d;
-          scala.this.Predef.println(DDDDD.this.x1().==(DDDDD.this.x2()));
-          scala.this.Predef.println(x3.==(x4))
-        }
-      };
-      new DDDDD[Tsp](CCCCC_L.this.c).foo()
-    };
-    def test_J(T_TypeTag: Byte): Unit = CCCCC_L.this.test();
-    <paramaccessor> private[this] val c: Tsp = _
-  }
-}
-
-[Now checking: minibox-spec]
+error: type mismatch;
+ found   : DDDDD.this.x1.type (with underlying type Tsp @storage)
+ required: Tsp @storage

Compiling mb_nested_class_first.scala                                  ... [ OK ]
Compiling mb_nested_class_forth.scala                                  ... [ OK ]
Compiling mb_nested_class_second.scala                                 ... [ OK ]
Compiling mb_nested_class_third.scala                                  ... [ OK ]
Compiling mb_normalize_1.scala                                         ... [ OK ]
Compiling mb_normalize_2.scala                                         ... [ OK ]
Compiling mb_normalize_3.scala                                         ... [ OK ]
Compiling mb_normalize_4.scala                                         ... [ OK ]
Compiling mb_normalize_5.scala                                         ... [ OK ]
Compiling mb_normalize_6.scala                                         ... [ OK ]
Compiling mb_normalize_7.scala                                         ... [ OK ]
Compiling mb_normalize_8.scala                                         ... [ OK ]
Compiling mb_normalize_9.scala                                         ... [ OK ]
Compiling mb_old_annot.scala                                           ... [ OK ]
Compiling mb_optimized_spec.scala                                      ... [ OK ]
Compiling mb_override_1.scala                                          ... [ OK ]
Compiling mb_override_2.scala                                          ... [ OK ]
Compiling mb_override_3.scala                                          ... [ OK ]
Compiling mb_override_4.scala                                          ... [ OK ]
Compiling mb_override_5.scala                                          ... [ OK ]
Compiling mb_override_6.scala                                          ... [ OK ]
Compiling mb_override_7.scala                                          ... [ OK ]
Compiling mb_partial_specialization_basic.scala                        ... [ OK ]
Compiling mb_rewire_method.scala                                       ... [FAIL]
Diff:
--- output
+++ expected
@@ -19,5 +19,5 @@
     };
     def test[T >: Nothing <: Any](): T = {
-      new miniboxing.tests.compile.TR_J[Int](5).foo_J(5, MiniboxConversions.this.box2minibox_tt[Int](3, 5));
+      MiniboxConversions.this.minibox2box[Int](new miniboxing.tests.compile.TR_J[Int](5).foo_J(5, MiniboxConversions.this.box2minibox_tt[Int](3, 5)), 5);
       new miniboxing.tests.compile.TR_L[String]().foo("xxx");
       new miniboxing.tests.compile.TR_L[T]().foo(scala.this.Predef.???())

Compiling mb_rewire_method_advanced.scala                              ... [FAIL]
Diff:
--- output
+++ expected
@@ -66,70 +66,6 @@

 [Now checking: minibox-dupl]
+newSource1.scala:19: error: reassignment to val
+class OhUh[@miniboxed U](var u: U) {
+                             ^
 [Not checkable: minibox-adapt]
-[[syntax trees at end of              minibox-spec]] // newSource1.scala
-package miniboxing.tests.compile {
-  abstract trait UhOh[@miniboxed X >: Nothing <: Any, Y >: Nothing <: Any] extends Object {
-    def foo(x: X, y: Y): X;
-    def foo_J(X_TypeTag: Byte, x: Long, y: Y): Long
-  };
-  abstract trait OhUh[@miniboxed U >: Nothing <: Any] extends Object {
-    <accessor> <paramaccessor> def u(): U;
-    <accessor> <paramaccessor> def u_=(x$1: U): Unit;
-    def test(): U;
-    def test_J(U_TypeTag: Byte): Long;
-    <accessor> <paramaccessor> def u_J(U_TypeTag: Byte): Long;
-    <accessor> <paramaccessor> def u_J_=(U_TypeTag: Byte, x$1: Long): Unit
-  };
-  class UhOh_J[Xsp >: Nothing <: Any, Ysp >: Nothing <: Any] extends Object with miniboxing.tests.compile.UhOh[Xsp,Ysp] {
-    def <init>(miniboxing|tests|compile|UhOh_J|X_TypeTag: Byte): miniboxing.tests.compile.UhOh_J[Xsp,Ysp] = {
-      UhOh_J.super.<init>();
-      ()
-    };
-    def foo(x: Xsp, y: Ysp): Xsp = MiniboxConversions.this.minibox2box[Xsp](UhOh_J.this.foo_J(UhOh_J.this.miniboxing|tests|compile|UhOh_J|X_TypeTag, MiniboxConversions.this.box2minibox_tt[Xsp](x, UhOh_J.this.miniboxing|tests|compile|UhOh_J|X_TypeTag), y), UhOh_J.this.miniboxing|tests|compile|UhOh_J|X_TypeTag);
-    def foo_J(X_TypeTag: Byte, x: Long, y: Ysp): Long = UhOh_J.this.foo_J(X_TypeTag, x, y);
-    <paramaccessor> private[this] val miniboxing|tests|compile|UhOh_J|X_TypeTag: Byte = _
-  };
-  class UhOh_L[Xsp >: Nothing <: Any, Ysp >: Nothing <: Any] extends Object with miniboxing.tests.compile.UhOh[Xsp,Ysp] {
-    def <init>(): miniboxing.tests.compile.UhOh_L[Xsp,Ysp] = {
-      UhOh_L.super.<init>();
-      ()
-    };
-    def foo(x: Xsp, y: Ysp): Xsp = UhOh_L.this.foo(x, y);
-    def foo_J(X_TypeTag: Byte, x: Long, y: Ysp): Long = MiniboxConversions.this.box2minibox_tt[Xsp](UhOh_L.this.foo(MiniboxConversions.this.minibox2box[Xsp](x, X_TypeTag), y), X_TypeTag)
-  };
-  class OhUh_J[Usp >: Nothing <: Any] extends Object with miniboxing.tests.compile.OhUh[Usp] {
-    def <init>(miniboxing|tests|compile|OhUh_J|U_TypeTag: Byte, u: Long): miniboxing.tests.compile.OhUh_J[Usp] = {
-      OhUh_J.super.<init>();
-      ()
-    };
-    def test(): Usp = MiniboxConversions.this.minibox2box[Usp](OhUh_J.this.test_J(OhUh_J.this.miniboxing|tests|compile|OhUh_J|U_TypeTag), OhUh_J.this.miniboxing|tests|compile|OhUh_J|U_TypeTag);
-    def test_J(U_TypeTag: Byte): Long = {
-      val tr: miniboxing.tests.compile.UhOh[Usp,Int] = new miniboxing.tests.compile.UhOh_J[Usp,Int](U_TypeTag);
-      tr.foo_J(U_TypeTag, OhUh_J.this.u_J(U_TypeTag), 3)
-    };
-    <accessor> <paramaccessor> def u(): Usp = MiniboxConversions.this.minibox2box[Usp](OhUh_J.this.u_J(OhUh_J.this.miniboxing|tests|compile|OhUh_J|U_TypeTag), OhUh_J.this.miniboxing|tests|compile|OhUh_J|U_TypeTag);
-    <accessor> <paramaccessor> def u_=(x$1: Usp): Unit = OhUh_J.this.u_J_=(OhUh_J.this.miniboxing|tests|compile|OhUh_J|U_TypeTag, MiniboxConversions.this.box2minibox_tt[Usp](x$1, OhUh_J.this.miniboxing|tests|compile|OhUh_J|U_TypeTag));
-    <accessor> <paramaccessor> def u_J(U_TypeTag: Byte): Long = OhUh_J.this.u;
-    <accessor> <paramaccessor> def u_J_=(U_TypeTag: Byte, x$1: Long): Unit = OhUh_J.this.u = x$1;
-    <paramaccessor> private[this] val miniboxing|tests|compile|OhUh_J|U_TypeTag: Byte = _;
-    <paramaccessor> private[this] var u: Long = _
-  };
-  class OhUh_L[Usp >: Nothing <: Any] extends Object with miniboxing.tests.compile.OhUh[Usp] {
-    def <init>(u: Usp): miniboxing.tests.compile.OhUh_L[Usp] = {
-      OhUh_L.super.<init>();
-      ()
-    };
-    def test(): Usp = {
-      val tr: miniboxing.tests.compile.UhOh[Usp,Int] = new miniboxing.tests.compile.UhOh_L[Usp,Int]();
-      tr.foo(OhUh_L.this.u(), 3)
-    };
-    def test_J(U_TypeTag: Byte): Long = MiniboxConversions.this.box2minibox_tt[Usp](OhUh_L.this.test(), U_TypeTag);
-    <accessor> <paramaccessor> def u(): Usp = OhUh_L.this.u;
-    <accessor> <paramaccessor> def u_=(x$1: Usp): Unit = OhUh_L.this.u = x$1;
-    <accessor> <paramaccessor> def u_J(U_TypeTag: Byte): Long = MiniboxConversions.this.box2minibox_tt[Usp](OhUh_L.this.u(), U_TypeTag);
-    <accessor> <paramaccessor> def u_J_=(U_TypeTag: Byte, x$1: Long): Unit = OhUh_L.this.u_=(MiniboxConversions.this.minibox2box[Usp](x$1, U_TypeTag));
-    <paramaccessor> private[this] var u: Usp = _
-  }
-}
-
-[Now checking: minibox-spec]

Compiling mb_rewire_new.scala                                          ... [ OK ]
Compiling mb_rewire_spire.scala                                        ... [ OK ]
Compiling mb_rewire_val.scala                                          ... [ OK ]
Compiling mb_signatures.scala                                          ... [FAIL]
Diff:
--- output
+++ expected
@@ -52,4 +52,6 @@

 [Now checking: minibox-dupl]
+newSource1.scala:3: error: reassignment to val
+class C[@miniboxed T](var x: T) {
+                          ^
 [Not checkable: minibox-adapt]
-[Now checking: minibox-spec]

Compiling mb_spec_hijack_1.scala                                       ... [ OK ]
Compiling mb_spec_hijack_2.scala                                       ... [ OK ]
Compiling mb_spire_1.scala                                             ... [ OK ]
Compiling mb_spire_10.scala                                            ... [FAIL]
Diff:
--- output
+++ expected
@@ -1,3 +1,5 @@
 [Now checking: minibox-dupl]
+newSource1.scala:17: error: reassignment to val
+      z = scalar.plus(z, scalar.times(v(i), w(i)))
+        ^
 [Not checkable: minibox-adapt]
-[Now checking: minibox-spec]

Compiling mb_spire_11.scala                                            ... [FAIL]
Diff:
--- output
+++ expected
@@ -1,3 +1,8 @@
 [Now checking: minibox-dupl]
+newSource1.scala:17: error: reassignment to val
+    z = scalar.zero
+      ^
+newSource1.scala:20: error: reassignment to val
+      z = scalar.plus(z, scalar.times(v(i), w(i)))
+        ^
 [Not checkable: minibox-adapt]
-[Now checking: minibox-spec]

Compiling mb_spire_13.scala                                            ... [ OK ]
Compiling mb_spire_14.scala                                            ... [ OK ]
Compiling mb_spire_2.scala                                             ... [ OK ]
Compiling mb_spire_3.scala                                             ... [ OK ]
Compiling mb_spire_4.scala                                             ... [ OK ]
Compiling mb_spire_4_1.scala                                           ... [ OK ]
Compiling mb_spire_4_2.scala                                           ... [ OK ]
Compiling mb_spire_5.scala                                             ... [ OK ]
Compiling mb_spire_6.scala                                             ... [ OK ]
Compiling mb_spire_7.scala                                             ... [ OK ]
Compiling mb_spire_8.scala                                             ... [FAIL]
Diff:
--- output
+++ expected
@@ -2,2 +2,5 @@
 [Not checkable: minibox-adapt]
 [Now checking: minibox-spec]
+newSource1.scala:6: error: could not optimize @tailrec annotated method euclid2_J: it contains a recursive call not in tail position
+  @tailrec final def euclid2(a: A, b: A): A = a match {
+                     ^

Compiling mb_super_1.scala                                             ... [ OK ]
Compiling mb_tparams_basic.scala                                       ... [ OK ]
Compiling mb_tparams_rewire_method.scala                               ... [FAIL]
Diff:
--- output
+++ expected
@@ -79,5 +79,5 @@
     };
     def test[T >: Nothing <: Any, A >: Nothing <: Any](a: A): T = {
-      new miniboxing.tests.compile.TR3_J[Int,String](5).foo_J[A, A](5, MiniboxConversions.this.box2minibox_tt[Int](3, 5), a, a);
+      MiniboxConversions.this.minibox2box[Int](new miniboxing.tests.compile.TR3_J[Int,String](5).foo_J[A, A](5, MiniboxConversions.this.box2minibox_tt[Int](3, 5), a, a), 5);
       new miniboxing.tests.compile.TR3_L[String,Int]().foo[A, Int]("xxx", a, 4);
       new miniboxing.tests.compile.TR3_L[T,Long]().foo[Int, Any](scala.this.Predef.???(), 2, 3)

```
Patching up tests: 9 down, 1 to go

`WildcardType`
Test case for the adapt issue
New adapt phase from valium written by @xeno-by