diff options
author | Guillaume Martres <smarter@ubuntu.com> | 2017-02-14 17:01:55 +0100 |
---|---|---|
committer | Guillaume Martres <smarter@ubuntu.com> | 2017-02-18 23:35:34 +0100 |
commit | 42e112b92a526bb9352febb14d8af48138bcfb87 (patch) | |
tree | d05b5915bbdeec5f65808c5c3c8f201bb3eac06a | |
parent | b2e4fe3212c226f03869c9f7c4d0b921a4e424de (diff) | |
download | dotty-42e112b92a526bb9352febb14d8af48138bcfb87.tar.gz dotty-42e112b92a526bb9352febb14d8af48138bcfb87.tar.bz2 dotty-42e112b92a526bb9352febb14d8af48138bcfb87.zip |
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.
-rw-r--r-- | compiler/src/dotty/tools/dotc/core/classfile/ClassfileParser.scala | 2 |
1 files changed, 1 insertions, 1 deletions
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 |