summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-07-23 20:50:24 +0000
committerPaul Phillips <paulp@improving.org>2011-07-23 20:50:24 +0000
commit5c61410fe5b8fd636bde6484f04a2d1160ed7eb4 (patch)
tree7d6d8068b148e0282bc5156d3e8fde1f9ac4fb7f /src/compiler/scala/tools/nsc/interpreter/ILoop.scala
parentf9f164d3c71aee897e7885e4c991866bd1c0c339 (diff)
downloadscala-5c61410fe5b8fd636bde6484f04a2d1160ed7eb4.tar.gz
scala-5c61410fe5b8fd636bde6484f04a2d1160ed7eb4.tar.bz2
scala-5c61410fe5b8fd636bde6484f04a2d1160ed7eb4.zip
Start of an attempt to abstract above some hard...
Start of an attempt to abstract above some hardcoded name mangling decisions so they can be modified, something we need to do to fix long-standing problems with inner classes. It's not easy. This commit doesn't actually change much, it's primarily setup. No review.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/ILoop.scala')
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/ILoop.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
index 8e7f73296f..8ae4f9779a 100644
--- a/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/ILoop.scala
@@ -18,6 +18,7 @@ import scala.concurrent.ops
import util.{ ClassPath, Exceptional, stringFromWriter, stringFromStream }
import interpreter._
import io.{ File, Sources }
+import scala.reflect.NameTransformer._
/** The Scala interactive shell. It provides a read-eval-print loop
* around the Interpreter class.
@@ -359,10 +360,10 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
if (rest.nonEmpty) {
intp optFlatName hd match {
case Some(flat) =>
- val clazz = flat :: rest mkString "$"
+ val clazz = flat :: rest mkString NAME_JOIN_STRING
val bytes = super.tryClass(clazz)
if (bytes.nonEmpty) bytes
- else super.tryClass(clazz + "$")
+ else super.tryClass(clazz + MODULE_SUFFIX_STRING)
case _ => super.tryClass(path)
}
}
@@ -371,7 +372,7 @@ class ILoop(in0: Option[BufferedReader], protected val out: JPrintWriter)
// we have to drop the $ to find object Foo, then tack it back onto
// the end of the flattened name.
def className = intp flatName path
- def moduleName = (intp flatName path.stripSuffix("$")) + "$"
+ def moduleName = (intp flatName path.stripSuffix(MODULE_SUFFIX_STRING)) + MODULE_SUFFIX_STRING
val bytes = super.tryClass(className)
if (bytes.nonEmpty) bytes