scala/scala — pull request #3402 by densh (2014-01-22 19:07:59+00:00)
Title: SI-7275 allow flattenning of blocks with ..$ 

This commit extends current splicing rules to allow flattening of
trees into other trees.

Without such support it is impossible to correctly create vals with
patterns and use it in other location as they could expand into
multiple-statement blocks:
```scala
scala> q"val (a, b) = (1, 2)"
res0: reflect.runtime.universe.Tree =
{
private[this] val x$1 = scala.Tuple2(1, 2):
@scala.unchecked match {
case scala.Tuple2((a @ _), (b @ _)) => scala.Tuple2(a, b)
};
val a = x$1._1;
val b = x$1._2;
()
}

scala> q"..$res0; println(a + b)"
res1: reflect.runtime.universe.Tree =
{
private[this] val x$1 = scala.Tuple2(1, 2):
@scala.unchecked match {
case scala.Tuple2((a @ _), (b @ _)) => scala.Tuple2(a, b)
};
val a = x$1._1;
val b = x$1._2;
println(a.$plus(b))
}
```
review by @xeno-by