summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-07-25 17:16:11 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-07-26 00:16:26 +0200
commitae28472bc727b25040da4b1428fcb14137d01102 (patch)
tree6926c1f62994557493270fafaf645783c6d9a30a /src
parentc3ac0ec12ee2b08917cdd0379b868a2fb12171d8 (diff)
downloadscala-ae28472bc727b25040da4b1428fcb14137d01102.tar.gz
scala-ae28472bc727b25040da4b1428fcb14137d01102.tar.bz2
scala-ae28472bc727b25040da4b1428fcb14137d01102.zip
SI-5958 This deserves a stable type
`this` (or the self variable) passed as an actual argument to a method should receive a singleton type when computing the method's resultType this is necessary if the method's type depends on that argument
Diffstat (limited to 'src')
-rw-r--r--src/reflect/scala/reflect/internal/TreeGen.scala2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/reflect/scala/reflect/internal/TreeGen.scala b/src/reflect/scala/reflect/internal/TreeGen.scala
index c3a6fce164..285700f9ff 100644
--- a/src/reflect/scala/reflect/internal/TreeGen.scala
+++ b/src/reflect/scala/reflect/internal/TreeGen.scala
@@ -143,6 +143,8 @@ abstract class TreeGen extends makro.TreeBuilder {
/** Computes stable type for a tree if possible */
def stableTypeFor(tree: Tree): Option[Type] = tree match {
+ case This(_) if tree.symbol != null && !tree.symbol.isError =>
+ Some(ThisType(tree.symbol))
case Ident(_) if tree.symbol.isStable =>
Some(singleType(tree.symbol.owner.thisType, tree.symbol))
case Select(qual, _) if ((tree.symbol ne null) && (qual.tpe ne null)) && // turned assert into guard for #4064