Skip to content

Commit

Permalink
Avoid crashing in ExplicitOuter on missing references
Browse files Browse the repository at this point in the history
  • Loading branch information
dwijnand committed Nov 10, 2022
1 parent d876acf commit 49be95a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/src/dotty/tools/dotc/transform/ExplicitOuter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import core.Phases._
import core.Types._
import core.Flags._
import core.Decorators._
import core.Scopes.*
import core.StdNames.nme
import core.Names._
import core.NameOps._
Expand Down Expand Up @@ -49,7 +50,7 @@ class ExplicitOuter extends MiniPhase with InfoTransformer { thisPhase =>
/** Add outer accessors if a class always needs an outer pointer */
override def transformInfo(tp: Type, sym: Symbol)(using Context): Type = tp match {
case tp @ ClassInfo(_, cls, _, decls, _) if needsOuterAlways(cls) =>
val newDecls = decls.cloneScope
val newDecls = if decls == EmptyScope then newScope else decls.cloneScope
newOuterAccessors(cls).foreach(newDecls.enter)
tp.derivedClassInfo(decls = newDecls)
case _ =>
Expand Down

0 comments on commit 49be95a

Please sign in to comment.