From 367b82de04bdee24b0994e30c1464297eae16d74 Mon Sep 17 00:00:00 2001 From: Eugene Burmako Date: Mon, 30 Jul 2012 21:14:42 +0200 Subject: miscellaneous refinements of reflection API 1) Removed unnecessary (i.e. implementable with pattern matching) type APIs. 2) Renamed isHigherKinded to takesTypeArgs making it easier to understand. 2) typeParams and resultType have been moved from MethodType to MethodSymbol Strictly speaking they are superfluous, but they are used very often. --- src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala') diff --git a/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala b/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala index 56b9c7011c..202d5d3f82 100644 --- a/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala +++ b/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala @@ -212,8 +212,7 @@ trait TypeStrings { } private def tparamString[T: ru.TypeTag] : String = { - // [Eugene++ to Paul] needs review!! - def typeArguments: List[ru.Type] = ru.typeOf[T].typeArguments + def typeArguments: List[ru.Type] = ru.typeOf[T] match { case ru.TypeRef(_, _, args) => args; case _ => Nil } // [Eugene++] todo. need to use not the `rootMirror`, but a mirror with the REPL's classloader // how do I get to it? acquiring context classloader seems unreliable because of multithreading def typeVariables: List[java.lang.Class[_]] = typeArguments map (targ => ru.rootMirror.runtimeClass(targ)) -- cgit v1.2.3