summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/api
diff options
context:
space:
mode:
authorDenys Shabalin <denys.shabalin@typesafe.com>2014-02-25 12:36:27 +0100
committerDenys Shabalin <denys.shabalin@typesafe.com>2014-03-09 15:47:21 +0200
commit67d175f06db62e8af18851fc5694cfff2158d73b (patch)
treebe0ddf941355a07ee0a92cfb687260149a5c2c30 /src/reflect/scala/reflect/api
parent973f2255481c0ee3c9954d361ef3941186495c8f (diff)
downloadscala-67d175f06db62e8af18851fc5694cfff2158d73b.tar.gz
scala-67d175f06db62e8af18851fc5694cfff2158d73b.tar.bz2
scala-67d175f06db62e8af18851fc5694cfff2158d73b.zip
SI-8331 make sure type select & applied type doesn't match terms
Due to tree re-use it used to be the fact that type quasiquotes could match term trees. This commit makes sure selections and applied type and type applied are all non-overlapping between q and tq.
Diffstat (limited to 'src/reflect/scala/reflect/api')
-rw-r--r--src/reflect/scala/reflect/api/Internals.scala15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/reflect/scala/reflect/api/Internals.scala b/src/reflect/scala/reflect/api/Internals.scala
index 01f928ed61..d2e742726d 100644
--- a/src/reflect/scala/reflect/api/Internals.scala
+++ b/src/reflect/scala/reflect/api/Internals.scala
@@ -600,10 +600,11 @@ trait Internals { self: Universe =>
}
val SyntacticTypeApplied: SyntacticTypeAppliedExtractor
+ val SyntacticAppliedType: SyntacticTypeAppliedExtractor
trait SyntacticTypeAppliedExtractor {
def apply(tree: Tree, targs: List[Tree]): Tree
- def unapply(tree: Tree): Some[(Tree, List[Tree])]
+ def unapply(tree: Tree): Option[(Tree, List[Tree])]
}
val SyntacticApplied: SyntacticAppliedExtractor
@@ -784,6 +785,18 @@ trait Internals { self: Universe =>
def apply(expr: Tree, selectors: List[Tree]): Import
def unapply(imp: Import): Some[(Tree, List[Tree])]
}
+
+ val SyntacticSelectType: SyntacticSelectTypeExtractor
+ trait SyntacticSelectTypeExtractor {
+ def apply(qual: Tree, name: TypeName): Select
+ def unapply(tree: Tree): Option[(Tree, TypeName)]
+ }
+
+ val SyntacticSelectTerm: SyntacticSelectTermExtractor
+ trait SyntacticSelectTermExtractor {
+ def apply(qual: Tree, name: TermName): Select
+ def unapply(tree: Tree): Option[(Tree, TermName)]
+ }
}
@deprecated("Use `internal.reificationSupport` instead", "2.11.0")