From cbcdbd6fb8c0bf372a61b4ddd5b6ce181964776d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 22 Aug 2013 09:27:34 +0200 Subject: Various bug fixes for typer. --- src/dotty/tools/dotc/core/Names.scala | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/dotty/tools/dotc/core/Names.scala') 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("") + // can't move CONSTRUCTOR/EMPTY_PACKAGE to `nme` because of bootstrap failures in `encode`. + val CONSTRUCTOR = termName("") + val EMPTY_PACKAGE = termName("") + + val dontEncode = Set(CONSTRUCTOR, EMPTY_PACKAGE) def termNameBuilder: Builder[Char, TermName] = StringBuilder.newBuilder.mapResult(termName) -- cgit v1.2.3