File tree Expand file tree Collapse file tree 2 files changed +12
-19
lines changed
compiler/src/dotty/tools/dotc/core Expand file tree Collapse file tree 2 files changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -734,8 +734,6 @@ object Denotations {
734734 case _ => Signature .NotAMethod
735735 }
736736
737- def erasedName (implicit ctx : Context ): Name = symbol.erasedName
738-
739737 def derivedSingleDenotation (symbol : Symbol , info : Type )(implicit ctx : Context ): SingleDenotation =
740738 if ((symbol eq this .symbol) && (info eq this .info)) this
741739 else newLikeThis(symbol, info)
Original file line number Diff line number Diff line change @@ -444,23 +444,18 @@ object SymDenotations {
444444 /** `fullName` where `.' is the separator character */
445445 def fullName (implicit ctx : Context ): Name = fullNameSeparated(QualifiedName )
446446
447- private var myErasedName : Name = null
448-
449- final override def erasedName (implicit ctx : Context ): Name = {
450- if (myErasedName == null ) {
451- myErasedName = name
452- if (isTerm)
453- getAnnotation(defn.AlphaAnnot ) match {
454- case Some (ann) =>
455- ann.arguments match {
456- case Literal (Constant (str : String )) :: Nil => myErasedName = str.toTermName
457- case _ =>
458- }
459- case _ =>
460- }
461- }
462- myErasedName
463- }
447+ /** The name given in an `@alpha` annotation if one is present, `name` otherwise */
448+ final def erasedName (implicit ctx : Context ): Name =
449+ if (isTerm)
450+ getAnnotation(defn.AlphaAnnot ) match {
451+ case Some (ann) =>
452+ ann.arguments match {
453+ case Literal (Constant (str : String )) :: Nil => str.toTermName
454+ case _ => name
455+ }
456+ case _ => name
457+ }
458+ else name
464459
465460 // ----- Tests -------------------------------------------------
466461
You can’t perform that action at this time.
0 commit comments