aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/transform/ExplicitOuter.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2016-03-07 15:08:16 +0100
committerMartin Odersky <odersky@gmail.com>2016-03-12 16:08:37 +0100
commit294d21ff6168f1402efc04a52f8d26deaed31c2c (patch)
treefd63284ddd4e747717e2b0396aa66a5f23b4c90c /src/dotty/tools/dotc/transform/ExplicitOuter.scala
parent420878d609a19a01226e76e1b315db5a7eca3576 (diff)
downloaddotty-294d21ff6168f1402efc04a52f8d26deaed31c2c.tar.gz
dotty-294d21ff6168f1402efc04a52f8d26deaed31c2c.tar.bz2
dotty-294d21ff6168f1402efc04a52f8d26deaed31c2c.zip
Better error message when an outer path is not found.
Diffstat (limited to 'src/dotty/tools/dotc/transform/ExplicitOuter.scala')
-rw-r--r--src/dotty/tools/dotc/transform/ExplicitOuter.scala7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/transform/ExplicitOuter.scala b/src/dotty/tools/dotc/transform/ExplicitOuter.scala
index 4cf076c45..90ce6eb01 100644
--- a/src/dotty/tools/dotc/transform/ExplicitOuter.scala
+++ b/src/dotty/tools/dotc/transform/ExplicitOuter.scala
@@ -319,7 +319,12 @@ object ExplicitOuter {
val outerAccessorCtx = ctx.withPhaseNoLater(ctx.lambdaLiftPhase) // lambdalift mangles local class names, which means we cannot reliably find outer acessors anymore
ctx.log(i"outer to $toCls of $tree: ${tree.tpe}, looking for ${outerAccName(treeCls.asClass)(outerAccessorCtx)} in $treeCls")
if (treeCls == toCls) tree
- else loop(tree.select(outerAccessor(treeCls.asClass)(outerAccessorCtx)).ensureApplied)
+ else {
+ val acc = outerAccessor(treeCls.asClass)(outerAccessorCtx)
+ assert(acc.exists,
+ i"failure to construct path from ${ctx.owner.ownersIterator.toList}%/% to `this` of ${toCls.showLocated};\n${treeCls.showLocated} does not have an outer accessor")
+ loop(tree.select(acc).ensureApplied)
+ }
}
ctx.log(i"computing outerpath to $toCls from ${ctx.outersIterator.map(_.owner).toList}")
loop(start)