summaryrefslogtreecommitdiff
path: root/test/files/run/t5080.scala
blob: acb6167f465222bf732d184c31cedfda03d4db8a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import scala.language.implicitConversions
import scala.language.reflectiveCalls

object Test extends App {

  abstract class Value {
  }

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

  implicit def conversions(x: Value) = 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
}