We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 451bc85 commit 22c388fCopy full SHA for 22c388f
compiler/src/dotty/tools/dotc/core/Contexts.scala
@@ -274,11 +274,11 @@ object Contexts {
274
def effectiveScope(using Context): Scope =
275
val co: Symbol | Null = owner
276
if co != null && co.isClass then co.asClass.unforcedDecls
277
- else scope
+ else
278
+ val s: Scope | Null = scope
279
+ if s == null then EmptyScope else s
280
- def nestingLevel: Int =
- val sc: Scope | Null = effectiveScope
281
- if sc != null then sc.nestingLevel else 0
+ def nestingLevel: Int = effectiveScope.nestingLevel
282
283
/** Sourcefile corresponding to given abstract file, memoized */
284
def getSource(file: AbstractFile, codec: => Codec = Codec(settings.encoding.value)) = {
0 commit comments