aboutsummaryrefslogtreecommitdiff
path: root/tests/disabled/macro/run/reify_implicits-new.scala
blob: 5ff90871ab4cf32b88fba2c113cfadbb4b42d861 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import scala.language.{ implicitConversions, reflectiveCalls }
import scala.reflect.{ClassTag, classTag}
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval

object Test extends dotty.runtime.LegacyApp {
  reify {
    implicit def arrayWrapper[A : ClassTag](x: Array[A]) =
      new {
        def sort(p: (A, A) => Boolean) = {
          util.Sorting.stableSort(x, p); x
        }
      }
    val x = Array(2, 3, 1, 4)
    println("x = "+ x.sort((x: Int, y: Int) => x < y).toList)
  }.eval
}