aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/ExplicitOuter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2015-10-31 21:06:50 +0100
committerMartin Odersky <odersky@gmail.com>2015-10-31 21:06:50 +0100
commit4d39003f3ca112d03af1e7a51c9e59bf5eb510c5 (patch)
tree2f136f52db8963b03dfbe9e5f22ed92c24f7c7f0 /src/dotty/tools/dotc/transform/ExplicitOuter.scala
parent08e880231ff5facd55a80bed0391b22fe85a9f44 (diff)
downloaddotty-4d39003f3ca112d03af1e7a51c9e59bf5eb510c5.tar.gz
dotty-4d39003f3ca112d03af1e7a51c9e59bf5eb510c5.tar.bz2
dotty-4d39003f3ca112d03af1e7a51c9e59bf5eb510c5.zip
Require outer pointer also for proxies of enclosing classes.
There was a missing case where an outer pointer is required.
Diffstat (limited to 'src/dotty/tools/dotc/transform/ExplicitOuter.scala')
-rw-r--r--src/dotty/tools/dotc/transform/ExplicitOuter.scala11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/src/dotty/tools/dotc/transform/ExplicitOuter.scala
index 7391f3cec..024247734 100644
--- a/src/dotty/tools/dotc/transform/ExplicitOuter.scala
+++ b/src/dotty/tools/dotc/transform/ExplicitOuter.scala
@@ -220,9 +220,14 @@ object ExplicitOuter {
case id: Ident =>
id.tpe match {
case ref @ TermRef(NoPrefix, _) =>
- ref.symbol.is(Hoistable) && isOuter(id.symbol.owner.enclosingClass)
- // methods will be placed in enclosing class scope by LambdaLift, so they will get
- // an outer path then.
+ if (ref.symbol is Hoistable)
+ // ref.symbol will be placed in enclosing class scope by LambdaLift, so it might need
+ // an outer path then.
+ isOuter(ref.symbol.owner.enclosingClass)
+ else
+ // ref.symbol will get a proxy in immediately enclosing class. If this properly
+ // contains the current class, it needs an outer path.
+ ctx.owner.enclosingClass.owner.enclosingClass.isContainedIn(ref.symbol.owner)
case _ => false
}
case nw: New =>