Skip to content

Commit

Permalink
Merge pull request #9448 from dwijnand/names-ThisNameType
Browse files Browse the repository at this point in the history
Drop the "Name with" in Name's ThisNameType
  • Loading branch information
dwijnand committed Jan 25, 2021
2 parents d85a844 + 5f67e5f commit 0437dc5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/reflect/scala/reflect/internal/Names.scala
Expand Up @@ -201,15 +201,11 @@ trait Names extends api.Names {
type ThisNameType >: Null <: Name
protected[this] def thisName: ThisNameType

// Note that "Name with ThisNameType" should be redundant
// because ThisNameType <: Name, but due to scala/bug#6161 the
// compile loses track of this fact.

/** Index into name table */
final def start: Int = index

/** The next name in the same hash bucket. */
def next: Name with ThisNameType
def next: ThisNameType

/** The length of this name. */
final def length: Int = len
Expand All @@ -228,14 +224,15 @@ trait Names extends api.Names {
(if (other.isTermName) toTermName else toTypeName).asInstanceOf[N]

/** Return the subname with characters from from to to-1. */
def subName(from: Int, to: Int): Name with ThisNameType
def subName(from: Int, to: Int): ThisNameType

override def subSequence(from: Int, to: Int): CharSequence = subName(from, to)

/** Return a new name of the same variety. */
def newName(str: String): Name with ThisNameType
def newName(str: String): ThisNameType

/** Return a new name based on string transformation. */
def mapName(f: String => String): Name with ThisNameType = newName(f(toString))
def mapName(f: String => String): ThisNameType = newName(f(toString))

/** Copy bytes of this name to buffer cs, starting at position `offset`. */
final def copyChars(cs: Array[Char], offset: Int) =
Expand Down

0 comments on commit 0437dc5

Please sign in to comment.