summaryrefslogtreecommitdiff
path: root/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-05-23 10:00:50 -0700
committerPaul Phillips <paulp@improving.org>2013-05-23 12:07:45 -0700
commitd8b96bb8583161e59180527bab0283f783466426 (patch)
treea12ecf17379a579d5a2f4bda7a16819001eadb77 /src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
parentb8641a97d669c945a1b9f47b4e8934aa6c98ffd7 (diff)
downloadscala-d8b96bb8583161e59180527bab0283f783466426.tar.gz
scala-d8b96bb8583161e59180527bab0283f783466426.tar.bz2
scala-d8b96bb8583161e59180527bab0283f783466426.zip
Concision contribution.
We have lots of core classes for which we need not go through the symbol to get the type: ObjectClass.tpe -> ObjectTpe AnyClass.tpe -> AnyTpe I updated everything to use the concise/direct version, and eliminated a bunch of noise where places were calling typeConstructor, erasedTypeRef, and other different-seeming methods only to always wind up with the same type they would have received from sym.tpe. There's only one Object type, before or after erasure, with or without type arguments. Calls to typeConstructor were especially damaging because (see previous commit) it had a tendency to cache a different type than the type one would find via other means. The two types would compare =:=, but possibly not == and definitely not eq. (I still don't understand what == is expected to do with types.)
Diffstat (limited to 'src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala')
-rw-r--r--src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala b/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
index 19fa562234..8b8b668c9f 100644
--- a/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
+++ b/src/repl/scala/tools/nsc/interpreter/JLineCompletion.scala
@@ -15,7 +15,7 @@ import scala.reflect.internal.util.StringOps.longestCommonPrefix
class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput {
val global: intp.global.type = intp.global
import global._
- import definitions.{ PredefModule, AnyClass, AnyRefClass, ScalaPackage, JavaLangPackage }
+ import definitions._
import rootMirror.{ RootClass, getModuleIfDefined }
type ExecResult = Any
import intp.{ debugging }
@@ -39,7 +39,7 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput
// for some reason any's members don't show up in subclasses, which
// we need so 5.<tab> offers asInstanceOf etc.
- private def anyMembers = AnyClass.tpe.nonPrivateMembers
+ private def anyMembers = AnyTpe.nonPrivateMembers
def anyRefMethodsToShow = Set("isInstanceOf", "asInstanceOf", "toString")
def tos(sym: Symbol): String = sym.decodedName
@@ -152,7 +152,7 @@ class JLineCompletion(val intp: IMain) extends Completion with CompletionOutput
}
// not for completion but for excluding
- object anyref extends TypeMemberCompletion(AnyRefClass.tpe) { }
+ object anyref extends TypeMemberCompletion(AnyRefTpe) { }
// the unqualified vals/defs/etc visible in the repl
object ids extends CompletionAware {