Skip to content

Commit f8273c8

Browse files
committed
Avoid EmptyScope.cloneScope crashing, eg on missing references
1 parent 298ff3f commit f8273c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,7 @@ object Scopes {
467467
override def size: Int = 0
468468
override def nestingLevel: Int = 0
469469
override def toList(using Context): List[Symbol] = Nil
470-
override def cloneScope(using Context): MutableScope = unsupported("cloneScope")
470+
override def cloneScope(using Context): MutableScope = newScope(nestingLevel)
471471
override def lookupEntry(name: Name)(using Context): ScopeEntry | Null = null
472472
override def lookupNextEntry(entry: ScopeEntry)(using Context): ScopeEntry | Null = null
473473
}

0 commit comments

Comments
 (0)