Skip to content

Commit 5d5fc3c

Browse files
committed
Define NoSymbol.erasedName to be EmptyTermName
This will streamline some of the later matching code.
1 parent a25fe65 commit 5d5fc3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ object SymDenotations {
494494
def fullName(using Context): Name = fullNameSeparated(QualifiedName)
495495

496496
/** The name given in a `@targetName` annotation if one is present, `name` otherwise */
497-
final def erasedName(using Context): Name =
497+
def erasedName(using Context): Name =
498498
val targetNameAnnot =
499499
if isAllOf(ModuleClass | Synthetic) then companionClass.getAnnotation(defn.TargetNameAnnot)
500500
else getAnnotation(defn.TargetNameAnnot)
@@ -2323,6 +2323,7 @@ object SymDenotations {
23232323
override def mapInfo(f: Type => Type)(using Context): SingleDenotation = this
23242324

23252325
override def matches(other: SingleDenotation)(using Context): Boolean = false
2326+
override def erasedName(using Context): Name = EmptyTermName
23262327
override def mapInherited(ownDenots: PreDenotation, prevDenots: PreDenotation, pre: Type)(using Context): SingleDenotation = this
23272328
override def filterWithPredicate(p: SingleDenotation => Boolean): SingleDenotation = this
23282329
override def filterDisjoint(denots: PreDenotation)(using Context): SingleDenotation = this

0 commit comments

Comments
 (0)