summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/reflect
diff options
context:
space:
mode:
authorDenys Shabalin <denys.shabalin@typesafe.com>2014-03-22 13:14:37 +0100
committerEugene Burmako <xeno.by@gmail.com>2014-03-25 20:16:52 +0100
commit0bac64d64309e2f236ba25d8e57b1ea1f62d4d8c (patch)
treece121f4a26af1a6ea84248770b4bf7b92a7a58cc /src/compiler/scala/tools/reflect
parentc765537cb3532a7b88f1b68331840953f3e9d048 (diff)
downloadscala-0bac64d64309e2f236ba25d8e57b1ea1f62d4d8c.tar.gz
scala-0bac64d64309e2f236ba25d8e57b1ea1f62d4d8c.tar.bz2
scala-0bac64d64309e2f236ba25d8e57b1ea1f62d4d8c.zip
SI-8388 consistently match type trees by originals
Due to the fact that all TypTrees are transformed into TypeTrees during typechecking one couldn't treat typed type trees in the same way as they treat untyped type trees. This change implements support for pattern matching of TypeTrees as their corresponding TypTree equivalent using tree preserved in the original. The implementation itself is a trivial wrapping of regular TypTree extractors into MaybeTypeTreeOriginal.
Diffstat (limited to 'src/compiler/scala/tools/reflect')
-rw-r--r--src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala b/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala
index 1b8b0686e8..95113d5b00 100644
--- a/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala
+++ b/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala
@@ -193,8 +193,6 @@ trait Reifiers { self: Quasiquotes =>
reifyBuildCall(nme.SyntacticAppliedType, tpt, targs)
case SyntacticFunction(args, body) =>
reifyBuildCall(nme.SyntacticFunction, args, body)
- case SyntacticIdent(name, isBackquoted) =>
- reifyBuildCall(nme.SyntacticIdent, name, isBackquoted)
case SyntacticEmptyTypeTree() =>
reifyBuildCall(nme.SyntacticEmptyTypeTree)
case SyntacticImport(expr, selectors) =>
@@ -203,6 +201,20 @@ trait Reifiers { self: Quasiquotes =>
reifyBuildCall(nme.SyntacticPartialFunction, cases)
case SyntacticMatch(scrutinee, cases) =>
reifyBuildCall(nme.SyntacticMatch, scrutinee, cases)
+ case SyntacticTermIdent(name, isBackquoted) =>
+ reifyBuildCall(nme.SyntacticTermIdent, name, isBackquoted)
+ case SyntacticTypeIdent(name) =>
+ reifyBuildCall(nme.SyntacticTypeIdent, name)
+ case SyntacticCompoundType(parents, defns) =>
+ reifyBuildCall(nme.SyntacticCompoundType, parents, defns)
+ case SyntacticSingletonType(ref) =>
+ reifyBuildCall(nme.SyntacticSingletonType, ref)
+ case SyntacticTypeProjection(qual, name) =>
+ reifyBuildCall(nme.SyntacticTypeProjection, qual, name)
+ case SyntacticAnnotatedType(tpt, annot) =>
+ reifyBuildCall(nme.SyntacticAnnotatedType, tpt, annot)
+ case SyntacticExistentialType(tpt, where) =>
+ reifyBuildCall(nme.SyntacticExistentialType, tpt, where)
case Q(tree) if fillListHole.isDefinedAt(tree) =>
mirrorBuildCall(nme.SyntacticBlock, fillListHole(tree))
case Q(other) =>