summaryrefslogtreecommitdiff
path: root/test/files/run/t5277_1.scala
blob: 65232967c2908868e5c39d6b0419af17918ba4c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval

import scala.language.{ implicitConversions, postfixOps }
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
}