diff options
author | Martin Odersky <odersky@gmail.com> | 2013-08-22 09:27:34 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2013-08-22 09:27:34 +0200 |
commit | cbcdbd6fb8c0bf372a61b4ddd5b6ce181964776d (patch) | |
tree | 3586e93b3e71ca8f11b9b7bd7e6a80af1a226dcf /src/dotty/tools/dotc/core/Names.scala | |
parent | 4d8329667a71242e56907a73760f1212a96d9376 (diff) | |
download | dotty-cbcdbd6fb8c0bf372a61b4ddd5b6ce181964776d.tar.gz dotty-cbcdbd6fb8c0bf372a61b4ddd5b6ce181964776d.tar.bz2 dotty-cbcdbd6fb8c0bf372a61b4ddd5b6ce181964776d.zip |
Various bug fixes for typer.
Diffstat (limited to 'src/dotty/tools/dotc/core/Names.scala')
-rw-r--r-- | src/dotty/tools/dotc/core/Names.scala | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/dotty/tools/dotc/core/Names.scala b/src/dotty/tools/dotc/core/Names.scala index 77be4843c..5439d2d17 100644 --- a/src/dotty/tools/dotc/core/Names.scala +++ b/src/dotty/tools/dotc/core/Names.scala @@ -106,7 +106,7 @@ object Names { /** Replace operator symbols by corresponding \$op_name's. */ def encode: Name = - if (this eq CONSTRUCTOR) this else NameTransformer.encode(this) + if (dontEncode(toTermName)) this else NameTransformer.encode(this) /** A more efficient version of concatenation */ def ++ (other: Name): ThisName = ++ (other.toString) @@ -320,8 +320,11 @@ object Names { /** The type name represented by the empoty string */ val EmptyTypeName = EmptyTermName.toTypeName - // can't use nme.CONSTRUCTOR in encode because of bootstrap failures. - private val CONSTRUCTOR = termName("<init>") + // can't move CONSTRUCTOR/EMPTY_PACKAGE to `nme` because of bootstrap failures in `encode`. + val CONSTRUCTOR = termName("<init>") + val EMPTY_PACKAGE = termName("<empty>") + + val dontEncode = Set(CONSTRUCTOR, EMPTY_PACKAGE) def termNameBuilder: Builder[Char, TermName] = StringBuilder.newBuilder.mapResult(termName) |