summaryrefslogtreecommitdiff
path: root/test/files/run/reify_extendbuiltins.scala
blob: f95e9ab6ecf2099c679ff8c2cd8499694f48045f (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 {
    def fact(n: Int): BigInt =
      if (n == 0) 1 else fact(n-1) * n
    class Factorizer(n: Int) {
      def ! = fact(n)
    }
    implicit def int2fact(n: Int) = new Factorizer(n)

    println("10! = " + (10!))
  }.eval
}