aboutsummaryrefslogblamecommitdiff
path: root/tests/pending/run/t5277_1.scala
blob: 58009866600a3465999e495e6964c4ff9c18e7bc (plain) (tree)
1
2
3
4
5



                                                         
                                             










                                                     
import scala.reflect.runtime.universe._
import scala.tools.reflect.Eval

import scala.language.{ implicitConversions, postfixOps }
object Test extends dotty.runtime.LegacyApp {
  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
}