Skip to content

Commit 5cbdf5c

Browse files
committed
Handle inner classes defined in suppercalls.
1 parent 0f9132d commit 5cbdf5c

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
485485
val original = toDenot(sym).initial
486486
val validity = original.validFor
487487
val shiftedContext = ctx.withPhase(validity.phaseId)
488-
val r = toDenot(sym)(shiftedContext).maybeOwner
488+
val r = toDenot(sym)(shiftedContext).maybeOwner.enclosingClass(shiftedContext)
489489
r
490490
} else NoSymbol
491491
} catch {

src/dotty/tools/dotc/core/SymDenotations.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -716,6 +716,9 @@ object SymDenotations {
716716
* but in turn the enclosing class of the latter. This reflects
717717
* the context created by `Context#superCallContext`, `Contect#thisCallArgContext`
718718
* for these definitions.
719+
*
720+
* Note, that as packages have ClassSymbols, top level classes will have an `enclosingClass`
721+
* with Package flag set.
719722
*/
720723
final def enclosingClass(implicit ctx: Context): Symbol = {
721724
def enclClass(sym: Symbol, skip: Boolean): Symbol = {

0 commit comments

Comments
 (0)