scala/scala — pull request #3713 by folone (2014-05-05 19:26:58+00:00)
Title: SI-8032 Provides an implicit macro for materialization of Liftable for case classes

Now that development of 2.12 has started, reopening this PR.

Case classes can now be used in quasiquotes.

```scala
Welcome to Scala version 2.11.1-20140505-184318-2e6e13ff25 (Java HotSpot(TM) 64-Bit Server VM, Java 1.7.0_51).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import scala.reflect.runtime.{universe => u}
import scala.reflect.runtime.{universe=>u}

scala> import u._
import u._

scala> case class Test(str: String, i: Int, lst: List[Double])
defined class Test

scala> val test = Test("test", 1, List(2.0, 3.5))
test: Test = Test(test,1,List(2.0, 3.5))

scala> showRaw(q"$test")
res0: String = Apply(Ident(Test), List(Literal(Constant("test")), Literal(Constant(1)), Apply(Select(Select(Select(Ident(scala), TermName("collection")), TermName("immutable")), TermName("List")), List(Literal(Constant(2.0)), Literal(Constant(3.5))))))

scala> val cm = runtimeMirror(getClass.getClassLoader)
cm: reflect.runtime.universe.Mirror = JavaMirror with scala.tools.nsc.interpreter.IMain$TranslatingClassLoader@75293656 of type class scala.tools.nsc.interpreter.IMain$TranslatingClassLoader with classpath [(memory)] and parent being scala.reflect.internal.util.ScalaClassLoader$URLClassLoader@64ae8431 of type class scala.reflect.internal.util.ScalaClassLoader$URLClassLoader with classpath [file:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/resources.jar,file:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/rt.jar,file:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jsse.jar,file:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/jce.jar,file:/Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Con...
scala> import scala.tools.reflect.ToolBox
import scala.tools.reflect.ToolBox

scala> val tb = cm.mkToolBox()
tb: scala.tools.reflect.ToolBox[reflect.runtime.universe.type] = scala.tools.reflect.ToolBoxFactory$ToolBoxImpl@641c66ff

scala> tb.eval(q"$test")
res1: Any = Test(test,1,List(2.0, 3.5))

scala> .asInstanceOf[Test]
res2: Test = Test(test,1,List(2.0, 3.5))
```

Review by @xeno-by, @densh, and @retronym please.