From f8273c8bc33afde989b46e31eb95f982550b2ad9 Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Thu, 10 Nov 2022 14:21:24 +0000 Subject: [PATCH] Avoid EmptyScope.cloneScope crashing, eg on missing references --- compiler/src/dotty/tools/dotc/core/Scopes.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/src/dotty/tools/dotc/core/Scopes.scala b/compiler/src/dotty/tools/dotc/core/Scopes.scala index 863ae4fa6b7f..99076b422358 100644 --- a/compiler/src/dotty/tools/dotc/core/Scopes.scala +++ b/compiler/src/dotty/tools/dotc/core/Scopes.scala @@ -467,7 +467,7 @@ object Scopes { override def size: Int = 0 override def nestingLevel: Int = 0 override def toList(using Context): List[Symbol] = Nil - override def cloneScope(using Context): MutableScope = unsupported("cloneScope") + override def cloneScope(using Context): MutableScope = newScope(nestingLevel) override def lookupEntry(name: Name)(using Context): ScopeEntry | Null = null override def lookupNextEntry(entry: ScopeEntry)(using Context): ScopeEntry | Null = null }