Skip to content

Commit 22c388f

Browse files
committed
Update effectiveScope
1 parent 451bc85 commit 22c388f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/src/dotty/tools/dotc/core/Contexts.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,11 @@ object Contexts {
274274
def effectiveScope(using Context): Scope =
275275
val co: Symbol | Null = owner
276276
if co != null && co.isClass then co.asClass.unforcedDecls
277-
else scope
277+
else
278+
val s: Scope | Null = scope
279+
if s == null then EmptyScope else s
278280

279-
def nestingLevel: Int =
280-
val sc: Scope | Null = effectiveScope
281-
if sc != null then sc.nestingLevel else 0
281+
def nestingLevel: Int = effectiveScope.nestingLevel
282282

283283
/** Sourcefile corresponding to given abstract file, memoized */
284284
def getSource(file: AbstractFile, codec: => Codec = Codec(settings.encoding.value)) = {

0 commit comments

Comments
 (0)