blob: 4da8393cb6f5ac32d39b765c6e9e5816341fe3d3 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
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.resetAllAttrs(tcasee)
try {
println(tb.eval(rtcasee))
} catch {
// this is the current behaviour, rather than the desired behavior; see SI-5467
case _: ToolBoxError => println("error!")
}
}
|