summaryrefslogblamecommitdiff
path: root/test/files/run/idempotency-case-classes.scala
blob: 4ad132174dba67d6ee8f19b22095fa47032cce88 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                  
                                       
                 
                                      






                                                                                   
import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import scala.tools.reflect.{ToolBox, ToolBoxError}
import scala.tools.reflect.Eval

object Test extends App {
  val casee = reify {
    case class C(x: Int, y: Int)
    println(C(2, 3))
  }
  println(casee.eval)
  val tb = cm.mkToolBox()
  val tcasee = tb.typecheck(casee.tree)
  println(tcasee)
  val rtcasee = tb.untypecheck(tcasee)
  try {
    println(tb.eval(rtcasee))
  } catch {
    // this is the current behaviour, rather than the desired behavior; see SI-5467
    case _: ToolBoxError => println("error!")
  }
}