summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/reflect/quasiquotes/Holes.scala
diff options
context:
space:
mode:
authorDenys Shabalin <denys.shabalin@typesafe.com>2014-01-15 17:27:52 +0100
committerDenys Shabalin <denys.shabalin@typesafe.com>2014-01-16 11:28:42 +0100
commit6283c01462ff37755ebd06adaa633800105ba506 (patch)
tree0f341abeffa6ce11a0d3096e603e7a62f4299a61 /src/compiler/scala/tools/reflect/quasiquotes/Holes.scala
parentae4a2f0f7be884e050565243f3b651e49ceb72ef (diff)
downloadscala-6283c01462ff37755ebd06adaa633800105ba506.tar.gz
scala-6283c01462ff37755ebd06adaa633800105ba506.tar.bz2
scala-6283c01462ff37755ebd06adaa633800105ba506.zip
Give better names to UnliftHelper1 and UnliftHelper2
Previous ones were inscrutable but thankfully @xeno_by helped me out to find better alternatives.;
Diffstat (limited to 'src/compiler/scala/tools/reflect/quasiquotes/Holes.scala')
-rw-r--r--src/compiler/scala/tools/reflect/quasiquotes/Holes.scala14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/reflect/quasiquotes/Holes.scala b/src/compiler/scala/tools/reflect/quasiquotes/Holes.scala
index 6427427828..8a54519401 100644
--- a/src/compiler/scala/tools/reflect/quasiquotes/Holes.scala
+++ b/src/compiler/scala/tools/reflect/quasiquotes/Holes.scala
@@ -166,16 +166,15 @@ trait Holes { self: Quasiquotes =>
/** Full support for unliftable implies that it's possible to interleave
* deconstruction with higher cardinality and unlifting of the values.
* In particular extraction of List[Tree] as List[T: Unliftable] requires
- * helper extractors that would do the job: UnliftHelper1[T]. Similarly
- * List[List[Tree]] needs UnliftHelper2[T].
+ * helper extractors that would do the job: UnliftListElementwise[T]. Similarly
+ * List[List[Tree]] needs UnliftListOfListsElementwise[T].
*
* See also "unlift list" tests in UnapplyProps.scala
*/
object unlifters {
private var records = List.empty[(Type, Cardinality)]
- // Request an UnliftHelperN[T] where n == card and T == tpe.
- // If card == 0 then helper is not needed and plain instance
- // of unliftable is returned.
+ // Materialize unlift helper that does elementwise
+ // unlifting for corresponding cardinality and type.
def spawn(tpe: Type, card: Cardinality): Option[Tree] = {
val unlifter = inferUnliftable(tpe)
if (unlifter == EmptyTree) None
@@ -190,7 +189,10 @@ trait Holes { self: Quasiquotes =>
def preamble(): List[Tree] =
records.zipWithIndex.map { case ((tpe, card), idx) =>
val name = TermName(nme.QUASIQUOTE_UNLIFT_HELPER + idx)
- val helperName = card match { case DotDot => nme.UnliftHelper1 case DotDotDot => nme.UnliftHelper2 }
+ val helperName = card match {
+ case DotDot => nme.UnliftListElementwise
+ case DotDotDot => nme.UnliftListOfListsElementwise
+ }
val lifter = inferUnliftable(tpe)
assert(helperName.isTermName)
// q"val $name: $u.build.${helperName.toTypeName} = $u.build.$helperName($lifter)"