blob: 7636fd38db573c69b2526440091a7fd84cc5c65d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
import scala.reflect.runtime.universe._
object Test extends App {
// HAHA!!!
// no compileTimeOnly errors here, because scalac does constant folding
// the type of reify(42) is Expr[42.type]
// therefore the type of expr.splice is 42.type, which is then constfolded
val expr = reify(42)
val ignored1 = expr.splice
val ignored2 = expr.value
val fortyTwo = 42
val ignored3 = reify(fortyTwo).splice
val ignored4 = reify(fortyTwo).value
}
|