aboutsummaryrefslogtreecommitdiff
path: root/src/dotty/tools/dotc/core/StdNames.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2013-05-24 16:37:47 +0200
committerMartin Odersky <odersky@gmail.com>2013-05-24 16:39:06 +0200
commitacc2b198692687394c9f8f84b16a0bec9ae12ee3 (patch)
treef9a9d588a629315aa82ddcee8c285d7614ed3201 /src/dotty/tools/dotc/core/StdNames.scala
parente1be722f469c45e7546388359b5870a07f4c14b8 (diff)
downloaddotty-acc2b198692687394c9f8f84b16a0bec9ae12ee3.tar.gz
dotty-acc2b198692687394c9f8f84b16a0bec9ae12ee3.tar.bz2
dotty-acc2b198692687394c9f8f84b16a0bec9ae12ee3.zip
NameTransformer.encode now goes from names to names.
Also, special treatment of <init>, which is not encoded.
Diffstat (limited to 'src/dotty/tools/dotc/core/StdNames.scala')
-rw-r--r--src/dotty/tools/dotc/core/StdNames.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/dotty/tools/dotc/core/StdNames.scala b/src/dotty/tools/dotc/core/StdNames.scala
index ea671ed8a..ada74c69d 100644
--- a/src/dotty/tools/dotc/core/StdNames.scala
+++ b/src/dotty/tools/dotc/core/StdNames.scala
@@ -17,6 +17,7 @@ object StdNames {
abstract class DefinedNames[N <: Name] {
protected implicit def fromString(s: String): N
+ protected def fromName(name: Name): N = fromString(name.toString)
private val kws = mutable.Set[N]()
protected def kw(name: N) = { kws += name; name }
@@ -25,7 +26,7 @@ object StdNames {
}
abstract class ScalaNames[N <: Name] extends DefinedNames[N] {
- private def encode(s: String): N = fromString(NameTransformer.encode(s))
+ private def encode(s: String): N = fromName(fromString(s).encode)
// Keywords, need to come first -----------------------