summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/Names.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-08-16 15:01:23 -0700
committerPaul Phillips <paulp@improving.org>2012-09-01 20:17:22 -0700
commit178f7a4511cf4274a8bc3016d9ac8481202128d2 (patch)
tree769f3b6d83ceda36354bfec754c91e62096430a1 /src/reflect/scala/reflect/internal/Names.scala
parentd3d195966b4556065d0658e7ed09f38e00eed593 (diff)
downloadscala-178f7a4511cf4274a8bc3016d9ac8481202128d2.tar.gz
scala-178f7a4511cf4274a8bc3016d9ac8481202128d2.tar.bz2
scala-178f7a4511cf4274a8bc3016d9ac8481202128d2.zip
Worked around SI-6161 by annotating abstract type.
Diffstat (limited to 'src/reflect/scala/reflect/internal/Names.scala')
-rw-r--r--src/reflect/scala/reflect/internal/Names.scala12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/reflect/scala/reflect/internal/Names.scala b/src/reflect/scala/reflect/internal/Names.scala
index 2fdf27d847..3f85db0f54 100644
--- a/src/reflect/scala/reflect/internal/Names.scala
+++ b/src/reflect/scala/reflect/internal/Names.scala
@@ -149,11 +149,15 @@ trait Names extends api.Names with LowPriorityNames {
type ThisNameType >: Null <: Name
protected[this] def thisName: ThisNameType
+ // Note that "Name with ThisNameType" should be redundant
+ // because ThisNameType <: Name, but due to SI-6161 the
+ // compile loses track of this fact.
+
/** Index into name table */
def start: Int = index
/** The next name in the same hash bucket. */
- def next: ThisNameType
+ def next: Name with ThisNameType
/** The length of this name. */
final def length: Int = len
@@ -169,13 +173,13 @@ trait Names extends api.Names with LowPriorityNames {
def bothNames: List[Name] = List(toTermName, toTypeName)
/** Return the subname with characters from from to to-1. */
- def subName(from: Int, to: Int): ThisNameType
+ def subName(from: Int, to: Int): Name with ThisNameType
/** Return a new name of the same variety. */
- def newName(str: String): ThisNameType
+ def newName(str: String): Name with ThisNameType
/** Return a new name based on string transformation. */
- def mapName(f: String => String): ThisNameType = newName(f(toString))
+ def mapName(f: String => String): Name with ThisNameType = newName(f(toString))
/** Copy bytes of this name to buffer cs, starting at position `offset`. */
final def copyChars(cs: Array[Char], offset: Int) =