Skip to content

Commit

Permalink
Drop unused name tags
Browse files Browse the repository at this point in the history
Drop unused AvoidClashName name kind and name tags
AVIDCLASH and DIRECT
  • Loading branch information
odersky committed Mar 13, 2020
1 parent 800251d commit de074d9
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/NameOps.scala
Expand Up @@ -128,7 +128,7 @@ object NameOps {
/** If flags is a ModuleClass but not a Package, add module class suffix */
def adjustIfModuleClass(flags: FlagSet): N = likeSpacedN {
if (flags.is(ModuleClass, butNot = Package)) name.asTypeName.moduleClassName
else name.toTermName.exclude(AvoidClashName)
else name.toTermName
}

/** The expanded name.
Expand Down
9 changes: 0 additions & 9 deletions compiler/src/dotty/tools/dotc/core/NameTags.scala
Expand Up @@ -17,13 +17,6 @@ object NameTags extends TastyFormat.NameTags {

final val INITIALIZER = 26 // A mixin initializer method

final val AVOIDCLASH = 27 // Adds a suffix to avoid a name clash;
// Used in FirstTransform for synthesized companion objects of classes
// if they would clash with another value.

final val DIRECT = 28 // Used by ShortCutImplicits for the name of methods that
// implement implicit function result types directly.

final val FIELD = 29 // Used by Memoize to tag the name of a class member field.

final val EXTMETH = 30 // Used by ExtensionMethods for the name of an extension method
Expand Down Expand Up @@ -51,8 +44,6 @@ object NameTags extends TastyFormat.NameTags {
case INLINEACCESSOR => "INLINEACCESSOR"
case PROTECTEDACCESSOR => "PROTECTEDACCESSOR"
case INITIALIZER => "INITIALIZER"
case AVOIDCLASH => "AVOIDCLASH"
case DIRECT => "DIRECT"
case FIELD => "FIELD"
case EXTMETH => "EXTMETH"
case IMPLMETH => "IMPLMETH"
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymDenotations.scala
Expand Up @@ -282,7 +282,7 @@ object SymDenotations {
*/
def effectiveName(implicit ctx: Context): Name =
if (this.is(ModuleClass)) name.stripModuleClassSuffix
else name.exclude(AvoidClashName)
else name

/** The privateWithin boundary, NoSymbol if no boundary is given.
*/
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Checking.scala
Expand Up @@ -851,7 +851,7 @@ trait Checking {
typr.println(i"check no double declarations $cls")

def checkDecl(decl: Symbol): Unit = {
for (other <- seen(decl.name) if (!decl.isAbsent() && !other.isAbsent())) {
for (other <- seen(decl.name) if !decl.isAbsent() && !other.isAbsent()) {
typr.println(i"conflict? $decl $other")
def javaFieldMethodPair =
decl.is(JavaDefined) && other.is(JavaDefined) &&
Expand Down
5 changes: 2 additions & 3 deletions library/src/scala/annotation/internal/Child.scala
@@ -1,6 +1,5 @@
package scala.annotation.internal

import scala.annotation.Annotation
package scala.annotation
package internal

/** An annotation to indicate a child class or object of the annotated class.
* E.g. if we have
Expand Down

0 comments on commit de074d9

Please sign in to comment.