summaryrefslogtreecommitdiff
path: root/test/files/run/reify_implicits-new.scala
blob: 69198391d18460ac86687d8afbed8d7059802e40 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import scala.reflect.mirror._

object Test extends App {
  reify {
    implicit def arrayWrapper[A : ArrayTag](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
}