Skip to content

Commit 20d308b

Browse files
committed
Fix owner for summarizing potentials of outer prefixes
1 parent 3939314 commit 20d308b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

compiler/src/dotty/tools/dotc/transform/init/Checking.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ object Checking {
5353
* However, summarization can be done lazily on-demand to improve
5454
* performance.
5555
*/
56-
def checkClassBody(cdef: TypeDef)(implicit state: State): Unit = traceOp("checking " + cdef.symbol.show, init) {
56+
def checkClassBody(cdef: TypeDef)(implicit state: State): Unit = {
57+
traceIndented("\n\n>>>> checking " + cdef.symbol.show, init)
58+
5759
val cls = cdef.symbol.asClass
5860
val tpl = cdef.rhs.asInstanceOf[Template]
5961

compiler/src/dotty/tools/dotc/transform/init/Summarization.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,10 +327,11 @@ object Summarization {
327327
def extractParentOuters(parent: Type, source: Tree): (ClassSymbol, Potentials) = {
328328
val tref = parent.typeConstructor.stripAnnots.asInstanceOf[TypeRef]
329329
val parentCls = tref.classSymbol.asClass
330+
val env2: Env = env.withOwner(cls.owner.lexicallyEnclosingClass)
330331
if (tref.prefix != NoPrefix)
331-
parentCls -> analyze(tref.prefix, source)(env.withOwner(cls))._1
332+
parentCls -> analyze(tref.prefix, source)(env2)._1
332333
else
333-
parentCls -> analyze(cls.owner.lexicallyEnclosingClass.thisType, source)(env.withOwner(cls))._1
334+
parentCls -> analyze(cls.owner.lexicallyEnclosingClass.thisType, source)(env2)._1
334335
}
335336

336337
if (cls.defTree.isEmpty)

0 commit comments

Comments
 (0)