aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Martres <smarter@ubuntu.com>2016-01-12 23:50:28 +0100
committerGuillaume Martres <smarter@ubuntu.com>2016-05-31 16:53:29 +0200
commit221e5d19da6e8cfbc6c0a1093c99b477a3592630 (patch)
tree9f0eaffd3633bff073a886882f4535c15512575b /src
parent088902cb6d86a5546f3f3aaf317ba78a51c0c604 (diff)
downloaddotty-221e5d19da6e8cfbc6c0a1093c99b477a3592630.tar.gz
dotty-221e5d19da6e8cfbc6c0a1093c99b477a3592630.tar.bz2
dotty-221e5d19da6e8cfbc6c0a1093c99b477a3592630.zip
Never include self types in named parts of a type
According to SLS ยง 7.2, self types are not a named part of a type, so they're not part of the implicit scope. Before this commit, this was usually the case because we normally refer to a class using a TypeRef, but in some cases a class might appear as a ThisType, and ThisType#underlying returns the self type, we now use ThisType#tref instead which just returns a TypeRef corresponding to the class.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index a318390d1..42079b4b8 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -3450,7 +3450,7 @@ object Types {
case TypeBounds(_, hi) =>
apply(x, hi)
case tp: ThisType =>
- apply(x, tp.underlying)
+ apply(x, tp.tref)
case tp: ConstantType =>
apply(x, tp.underlying)
case tp: MethodParam =>