aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-02 18:16:22 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-04-02 18:16:22 +0200
commit5cbdf5c28b843c79616243e5f1c882d55304b6e9 (patch)
tree9e16061fbd7e67fd2f2cfdacdb24365d4216114e /src
parent0f9132d6fa362e8ff5a8670afcd23f836f22dbd9 (diff)
downloaddotty-5cbdf5c28b843c79616243e5f1c882d55304b6e9.tar.gz
dotty-5cbdf5c28b843c79616243e5f1c882d55304b6e9.tar.bz2
dotty-5cbdf5c28b843c79616243e5f1c882d55304b6e9.zip
Handle inner classes defined in suppercalls.
Diffstat (limited to 'src')
-rw-r--r--src/dotty/tools/backend/jvm/DottyBackendInterface.scala2
-rw-r--r--src/dotty/tools/dotc/core/SymDenotations.scala3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
index 9e923de09..368145847 100644
--- a/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
+++ b/src/dotty/tools/backend/jvm/DottyBackendInterface.scala
@@ -485,7 +485,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
val original = toDenot(sym).initial
val validity = original.validFor
val shiftedContext = ctx.withPhase(validity.phaseId)
- val r = toDenot(sym)(shiftedContext).maybeOwner
+ val r = toDenot(sym)(shiftedContext).maybeOwner.enclosingClass(shiftedContext)
r
} else NoSymbol
} catch {
diff --git a/src/dotty/tools/dotc/core/SymDenotations.scala b/src/dotty/tools/dotc/core/SymDenotations.scala
index e8008eeb3..1285d3fdd 100644
--- a/src/dotty/tools/dotc/core/SymDenotations.scala
+++ b/src/dotty/tools/dotc/core/SymDenotations.scala
@@ -716,6 +716,9 @@ object SymDenotations {
* but in turn the enclosing class of the latter. This reflects
* the context created by `Context#superCallContext`, `Contect#thisCallArgContext`
* for these definitions.
+ *
+ * Note, that as packages have ClassSymbols, top level classes will have an `enclosingClass`
+ * with Package flag set.
*/
final def enclosingClass(implicit ctx: Context): Symbol = {
def enclClass(sym: Symbol, skip: Boolean): Symbol = {