Skip to content

Commit 28dc7e1

Browse files
committed
ClassfileParser: avoid looking up inner class in wrong phase
getMember needs to take an implicit `Context` parameter, otherwise the following code: val result = ctx.atPhaseNotLaterThan(ctx.typerPhase) { implicit ctx => getMember(owner, innerName.toTypeName) } will not run getMember at the typer phase.
1 parent 062b2e1 commit 28dc7e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ class ClassfileParser(
806806
def classSymbol(externalName: Name)(implicit ctx: Context): Symbol = {
807807
/** Return the symbol of `innerName`, having the given `externalName`. */
808808
def innerSymbol(externalName: Name, innerName: Name, static: Boolean): Symbol = {
809-
def getMember(sym: Symbol, name: Name): Symbol =
809+
def getMember(sym: Symbol, name: Name)(implicit ctx: Context): Symbol =
810810
if (static)
811811
if (sym == classRoot.symbol) staticScope.lookup(name)
812812
else sym.companionModule.info.member(name).symbol

0 commit comments

Comments
 (0)