Skip to content

Commit 8461cf4

Browse files
committed
Use union type for Name#derivedNames
1 parent 3419fb7 commit 8461cf4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ object Names {
185185
def underlying: TermName = unsupported("underlying")
186186

187187
@sharable // because of synchronized block in `and`
188-
private[this] var derivedNames: AnyRef /* immutable.Map[NameInfo, DerivedName] | j.u.HashMap */ =
188+
private[this] var derivedNames: immutable.Map[NameInfo, DerivedName] | HashMap[NameInfo, DerivedName] =
189189
immutable.Map.empty[NameInfo, DerivedName]
190190

191-
private def getDerived(info: NameInfo): DerivedName /* | Null */ = derivedNames match {
191+
private def getDerived(info: NameInfo): DerivedName /* | Null */ = (derivedNames: @unchecked) match {
192192
case derivedNames: immutable.AbstractMap[NameInfo, DerivedName] @unchecked =>
193193
if (derivedNames.contains(info)) derivedNames(info) else null
194194
case derivedNames: HashMap[NameInfo, DerivedName] @unchecked =>

0 commit comments

Comments
 (0)