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

object Test extends dotty.runtime.LegacyApp {
  reify {
    implicit def arrayWrapper[A : ClassManifest](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
}