aboutsummaryrefslogblamecommitdiff
path: root/tests/pending/run/t5080.scala
blob: c20e378bbf5afad79290b26f14119539c65bbc77 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13



                                         
                                             







                                            
                                                                    













                                            
import scala.language.implicitConversions
import scala.language.reflectiveCalls

object Test extends dotty.runtime.LegacyApp {

  abstract class Value {
  }

  case class Num(value: Int) extends Value {
    override def toString = value.toString;
  }

  implicit def conversions(x: Value): AnyRef{def toInt: Int} = new {
    def toInt =
      x match {
        case Num(n) => n
        case _ => throw new RuntimeException
      }
  }

  def eval(v: Value): Value = {
    println("hey")
    Num(1)
  }

  eval(Num(1)).toInt
}