From 42e112b92a526bb9352febb14d8af48138bcfb87 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Tue, 14 Feb 2017 17:01:55 +0100 Subject: 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. --- compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'compiler/src/dotty/tools/dotc/core/classfile') diff --git a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala index 5b751ef3c..36d478c6d 100644 --- a/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala +++ b/compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala @@ -806,7 +806,7 @@ class ClassfileParser( def classSymbol(externalName: Name)(implicit ctx: Context): Symbol = { /** Return the symbol of `innerName`, having the given `externalName`. */ def innerSymbol(externalName: Name, innerName: Name, static: Boolean): Symbol = { - def getMember(sym: Symbol, name: Name): Symbol = + def getMember(sym: Symbol, name: Name)(implicit ctx: Context): Symbol = if (static) if (sym == classRoot.symbol) staticScope.lookup(name) else sym.companionModule.info.member(name).symbol -- cgit v1.2.3