diff options
author | Martin Odersky <odersky@gmail.com> | 2014-03-19 11:00:53 +0100 |
---|---|---|
committer | Tobias Schlatter <tobias@meisch.ch> | 2014-03-21 11:28:30 +0100 |
commit | 40202eedb940d0614c08b1ba36c8648ed56ea332 (patch) | |
tree | 854a3b4e88bb06384d9e65a1eb853136ca903f1c /src/dotty | |
parent | 7e51434b89659c49a1cd755c224cc5ca270b82b3 (diff) | |
download | dotty-40202eedb940d0614c08b1ba36c8648ed56ea332.tar.gz dotty-40202eedb940d0614c08b1ba36c8648ed56ea332.tar.bz2 dotty-40202eedb940d0614c08b1ba36c8648ed56ea332.zip |
Fix of t1280 - type of self
The type of self name "x" was taken to be the thisType of the current owner.
But the current owner was a local dummy of the class in question, so the ThisType
was NoPrefix. Inserting an enclosingClass fixes the problem.
Diffstat (limited to 'src/dotty')
-rw-r--r-- | src/dotty/tools/dotc/typer/Typer.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/typer/Typer.scala b/src/dotty/tools/dotc/typer/Typer.scala index 4fdee86a3..7c301a7f1 100644 --- a/src/dotty/tools/dotc/typer/Typer.scala +++ b/src/dotty/tools/dotc/typer/Typer.scala @@ -209,7 +209,7 @@ class Typer extends Namer with TypeAssigner with Applications with Implicits wit if (qualifies(defDenot)) { val curOwner = ctx.owner val found = - if (isSelfDenot(defDenot)) curOwner.thisType + if (isSelfDenot(defDenot)) curOwner.enclosingClass.thisType else curOwner.thisType.select(name, defDenot) if (!(curOwner is Package) || (defDenot.symbol is Package) || isDefinedInCurrentUnit(defDenot)) return checkNewOrShadowed(found, definition) // no need to go further out, we found highest prec entry |