aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/Types.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-01-07 14:21:43 +0100
committerMartin Odersky <odersky@gmail.com>2016-02-19 13:59:59 +0100
commit91ccb52bda344d74ba7a3e9859346e57051d2aff (patch)
tree0368563b4f688f80e01534c06dd9a1632380b0ec /src/dotty/tools/dotc/core/Types.scala
parentd872d9ca54e9d56f563dc2e0bb002b38380af391 (diff)
downloaddotty-91ccb52bda344d74ba7a3e9859346e57051d2aff.tar.gz
dotty-91ccb52bda344d74ba7a3e9859346e57051d2aff.tar.bz2
dotty-91ccb52bda344d74ba7a3e9859346e57051d2aff.zip
Support named type parameters
Changes needed to support simple named type parameters. Not yet implemented: named arguments.
Diffstat (limited to 'src/dotty/tools/dotc/core/Types.scala')
-rw-r--r--src/dotty/tools/dotc/core/Types.scala8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala
index 8595da640..27828c588 100644
--- a/src/dotty/tools/dotc/core/Types.scala
+++ b/src/dotty/tools/dotc/core/Types.scala
@@ -485,7 +485,13 @@ object Types {
}
def goThis(tp: ThisType) = {
val d = go(tp.underlying)
- if (d.exists) d
+ if (d.exists)
+ if ((pre eq tp) && d.symbol.is(NamedTypeParam) && (d.symbol.owner eq tp.cls))
+ // If we look for a named type parameter `P` in `C.this.P`, looking up
+ // the fully applied self type of `C` will give as an info the alias type
+ // `P = this.P`. We need to return a denotation with the underlying bounds instead.
+ d.symbol.denot
+ else d
else
// There is a special case to handle:
// trait Super { this: Sub => private class Inner {} println(this.Inner) }