diff options
author | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-02-25 12:36:27 +0100 |
---|---|---|
committer | Denys Shabalin <denys.shabalin@typesafe.com> | 2014-03-09 15:47:21 +0200 |
commit | 67d175f06db62e8af18851fc5694cfff2158d73b (patch) | |
tree | be0ddf941355a07ee0a92cfb687260149a5c2c30 /src/compiler/scala/tools | |
parent | 973f2255481c0ee3c9954d361ef3941186495c8f (diff) | |
download | scala-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/compiler/scala/tools')
-rw-r--r-- | src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala b/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala index 5eae3b6e6f..ebb59f98fd 100644 --- a/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala +++ b/src/compiler/scala/tools/reflect/quasiquotes/Reifiers.scala @@ -185,6 +185,8 @@ trait Reifiers { self: Quasiquotes => reifyBuildCall(nme.SyntacticApplied, fun, argss) case SyntacticTypeApplied(fun, targs) if targs.nonEmpty => reifyBuildCall(nme.SyntacticTypeApplied, fun, targs) + case SyntacticAppliedType(tpt, targs) if targs.nonEmpty => + reifyBuildCall(nme.SyntacticAppliedType, tpt, targs) case SyntacticFunction(args, body) => reifyBuildCall(nme.SyntacticFunction, args, body) case SyntacticIdent(name, isBackquoted) => @@ -215,6 +217,11 @@ trait Reifiers { self: Quasiquotes => // correctness of the trees produced by quasiquotes case Select(id @ Ident(nme.scala_), name) if id.symbol == ScalaPackage => reifyBuildCall(nme.ScalaDot, name) + case Select(qual, name) => + if (name.isTypeName) + reifyBuildCall(nme.SyntacticSelectType, qual, name) + else + reifyBuildCall(nme.SyntacticSelectTerm, qual, name) case _ => super.reifyTreeSyntactically(tree) } |