aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/ast/Trees.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-11-21 10:22:07 +0100
committerMartin Odersky <odersky@gmail.com>2016-11-21 10:22:07 +0100
commit7f0637ce073131d8603c567329885e4443cd48d5 (patch)
treef94fa7e704b901d51fec272176090e174ffbb106 /src/dotty/tools/dotc/ast/Trees.scala
parent5c7617b006fe4446a105b3db4916956a92826304 (diff)
downloaddotty-7f0637ce073131d8603c567329885e4443cd48d5.tar.gz
dotty-7f0637ce073131d8603c567329885e4443cd48d5.tar.bz2
dotty-7f0637ce073131d8603c567329885e4443cd48d5.zip
Make This and Super take idents as qualifier/mixin
The qualifier of a This and the mixin of a Super were names, which meant that their positions were lost. Now they are untyped idents.
Diffstat (limited to 'src/dotty/tools/dotc/ast/Trees.scala')
-rw-r--r--src/dotty/tools/dotc/ast/Trees.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/dotty/tools/dotc/ast/Trees.scala b/src/dotty/tools/dotc/ast/Trees.scala
index 78ac66812..2801bcae2 100644
--- a/src/dotty/tools/dotc/ast/Trees.scala
+++ b/src/dotty/tools/dotc/ast/Trees.scala
@@ -159,7 +159,7 @@ object Trees {
/** Does this tree define a new symbol that is not defined elsewhere? */
def isDef: Boolean = false
- /** Is this tree either the empty tree or the empty ValDef? */
+ /** Is this tree either the empty tree or the empty ValDef or an empty type ident? */
def isEmpty: Boolean = false
/** Convert tree to a list. Gives a singleton list, except
@@ -353,7 +353,7 @@ object Trees {
}
/** qual.this */
- case class This[-T >: Untyped] private[ast] (qual: TypeName)
+ case class This[-T >: Untyped] private[ast] (qual: untpd.Ident)
extends DenotingTree[T] with TermTree[T] {
type ThisTree[-T >: Untyped] = This[T]
// Denotation of a This tree is always the underlying class; needs correction for modules.
@@ -368,7 +368,7 @@ object Trees {
}
/** C.super[mix], where qual = C.this */
- case class Super[-T >: Untyped] private[ast] (qual: Tree[T], mix: TypeName)
+ case class Super[-T >: Untyped] private[ast] (qual: Tree[T], mix: untpd.Ident)
extends ProxyTree[T] with TermTree[T] {
type ThisTree[-T >: Untyped] = Super[T]
def forwardTo = qual
@@ -890,12 +890,12 @@ object Trees {
case tree: Select if (qualifier eq tree.qualifier) && (name == tree.name) => tree
case _ => finalize(tree, untpd.Select(qualifier, name))
}
- def This(tree: Tree)(qual: TypeName): This = tree match {
- case tree: This if qual == tree.qual => tree
+ def This(tree: Tree)(qual: untpd.Ident): This = tree match {
+ case tree: This if qual eq tree.qual => tree
case _ => finalize(tree, untpd.This(qual))
}
- def Super(tree: Tree)(qual: Tree, mix: TypeName): Super = tree match {
- case tree: Super if (qual eq tree.qual) && (mix == tree.mix) => tree
+ def Super(tree: Tree)(qual: Tree, mix: untpd.Ident): Super = tree match {
+ case tree: Super if (qual eq tree.qual) && (mix eq tree.mix) => tree
case _ => finalize(tree, untpd.Super(qual, mix))
}
def Apply(tree: Tree)(fun: Tree, args: List[Tree])(implicit ctx: Context): Apply = tree match {