diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2012-07-30 21:14:42 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2012-08-02 15:36:58 +0200 |
commit | 367b82de04bdee24b0994e30c1464297eae16d74 (patch) | |
tree | 79480d2ac5adc812b0d50041ddeca5e910ffb46f /src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala | |
parent | 7112c66d6951ac83ae3591426291ec2797824258 (diff) | |
download | scala-367b82de04bdee24b0994e30c1464297eae16d74.tar.gz scala-367b82de04bdee24b0994e30c1464297eae16d74.tar.bz2 scala-367b82de04bdee24b0994e30c1464297eae16d74.zip |
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.
Diffstat (limited to 'src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala | 3 |
1 files changed, 1 insertions, 2 deletions
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)) |