summaryrefslogtreecommitdiff
path: root/src/reflect/scala/reflect/internal/Names.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2014-01-27 20:39:04 +0300
committerEugene Burmako <xeno.by@gmail.com>2014-02-14 13:24:47 +0100
commit3293d60531615f4accdee886fba52ddda0929b31 (patch)
tree59f4cf0ab64fe7413ede01e05d89ca2570a52e02 /src/reflect/scala/reflect/internal/Names.scala
parent356839e9f33db50d3c25d68ee1f371a1994b0f90 (diff)
downloadscala-3293d60531615f4accdee886fba52ddda0929b31.tar.gz
scala-3293d60531615f4accdee886fba52ddda0929b31.tar.bz2
scala-3293d60531615f4accdee886fba52ddda0929b31.zip
SI-8190 erasure identities for types in reflection API
Makes sure that almost every abstract type declared in reflection API erases to a unique class, so that they can be adequately used for method overloading to the same extent that tags allow them to be used in pattern matching. The only two exceptions from this rule are the types whose implementations we do not control: FlagSet that is implemented as Long and RuntimeClass that is implemented as java.lang.Class[_].
Diffstat (limited to 'src/reflect/scala/reflect/internal/Names.scala')
-rw-r--r--src/reflect/scala/reflect/internal/Names.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/reflect/scala/reflect/internal/Names.scala b/src/reflect/scala/reflect/internal/Names.scala
index 73ce59feb2..ae9f2da4e5 100644
--- a/src/reflect/scala/reflect/internal/Names.scala
+++ b/src/reflect/scala/reflect/internal/Names.scala
@@ -535,7 +535,7 @@ trait Names extends api.Names {
}
// SYNCNOTE: caller to constructor must synchronize if `synchronizeNames` is enabled
- sealed abstract class TermName(index0: Int, len0: Int, hash: Int) extends Name(index0, len0) {
+ sealed abstract class TermName(index0: Int, len0: Int, hash: Int) extends Name(index0, len0) with TermNameApi {
type ThisNameType = TermName
protected[this] def thisName: TermName = this
val next: TermName = termHashtable(hash)
@@ -572,7 +572,7 @@ trait Names extends api.Names {
def unapply(name: TermName): Option[String] = Some(name.toString)
}
- sealed abstract class TypeName(index0: Int, len0: Int, hash: Int) extends Name(index0, len0) {
+ sealed abstract class TypeName(index0: Int, len0: Int, hash: Int) extends Name(index0, len0) with TypeNameApi {
type ThisNameType = TypeName
protected[this] def thisName: TypeName = this