summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2011-03-28 08:25:21 +0000
committerIulian Dragos <jaguarul@gmail.com>2011-03-28 08:25:21 +0000
commit2a76132a56c7c426d55f563792b95ba073f83c5c (patch)
treecb32f347b12fc0cf15c3a3dea9e553f47e13365a /src
parent63466a4cf9c08c7bdc1a93ec8890502b68f2e20d (diff)
downloadscala-2a76132a56c7c426d55f563792b95ba073f83c5c.tar.gz
scala-2a76132a56c7c426d55f563792b95ba073f83c5c.tar.bz2
scala-2a76132a56c7c426d55f563792b95ba073f83c5c.zip
Merged revisions 24591 via svnmerge from
https://lampsvn.epfl.ch/svn-repos/scala/scala/trunk ........ r24591 | dragos | 2011-03-25 18:10:01 +0100 (Fri, 25 Mar 2011) | 1 line Set the original tree for TypeTree in self-types, and making sure there are no cycles in TypeTree.original. review by odersky. ........
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/ast/Trees.scala10
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala2
2 files changed, 10 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala
index cf612ad7a0..8bb7b77154 100644
--- a/src/compiler/scala/tools/nsc/ast/Trees.scala
+++ b/src/compiler/scala/tools/nsc/ast/Trees.scala
@@ -317,7 +317,15 @@ trait Trees extends reflect.generic.Trees { self: SymbolTable =>
private[Trees] var wasEmpty: Boolean = false
def original: Tree = orig
- def setOriginal(tree: Tree): this.type = { orig = tree; setPos(tree.pos); this }
+ def setOriginal(tree: Tree): this.type = {
+ def followOriginal(t: Tree): Tree = t match {
+ case tt: TypeTree => followOriginal(tt.original)
+ case t => t
+ }
+
+ orig = followOriginal(tree); setPos(tree.pos);
+ this
+ }
override def defineType(tp: Type): this.type = {
wasEmpty = isEmpty
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index b5e58a9dae..08d5f0e12d 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -1425,7 +1425,7 @@ trait Typers extends Modes {
val tpt1 =
checkNoEscaping.privates(
clazz.thisSym,
- treeCopy.TypeTree(tpt) setType vd.symbol.tpe)
+ treeCopy.TypeTree(tpt).setOriginal(tpt) setType vd.symbol.tpe)
treeCopy.ValDef(vd, mods, name, tpt1, EmptyTree) setType NoType
}
// was: