From 14e77b9c5071ea54bf3ace709037a1779d2c82f9 Mon Sep 17 00:00:00 2001 From: Denys Shabalin Date: Mon, 10 Mar 2014 12:09:48 +0200 Subject: Move extra tuple placeholder case to reifyTreePlaceholder --- src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala b/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala index b595e3ad2c..f8b5e7b6bd 100644 --- a/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala +++ b/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala @@ -131,6 +131,10 @@ trait Reifiers { self: Quasiquotes => case Placeholder(Hole(tree, NoDot)) if isReifyingPatterns => tree case Placeholder(hole @ Hole(_, rank @ Dot())) => c.abort(hole.pos, s"Can't $action with $rank here") case TuplePlaceholder(args) => reifyTuple(args) + // Due to greediness of syntactic applied we need to pre-emptively peek inside. + // `rest` will always be non-empty due to the rule on top of this one. + case SyntacticApplied(id @ Ident(nme.QUASIQUOTE_TUPLE), first :: rest) => + mirrorBuildCall(nme.SyntacticApplied, reifyTreePlaceholder(Apply(id, first)), reify(rest)) case TupleTypePlaceholder(args) => reifyTupleType(args) case FunctionTypePlaceholder(argtpes, restpe) => reifyFunctionType(argtpes, restpe) case CasePlaceholder(hole) => hole.tree @@ -181,10 +185,6 @@ trait Reifiers { self: Quasiquotes => reifyBuildCall(nme.SyntacticForYield, enums, body) case SyntacticAssign(lhs, rhs) => reifyBuildCall(nme.SyntacticAssign, lhs, rhs) - // rest will always be non-empty due to the fact that every single-parens - // application will be reified by reifyTreePlaceholder before it gets here. - case SyntacticApplied(id @ Ident(nme.QUASIQUOTE_TUPLE), first :: rest) => - mirrorBuildCall(nme.SyntacticApplied, reifyTreePlaceholder(Apply(id, first)), reify(rest)) case SyntacticApplied(fun, argss) if argss.nonEmpty => reifyBuildCall(nme.SyntacticApplied, fun, argss) case SyntacticTypeApplied(fun, targs) if targs.nonEmpty => -- cgit v1.2.3