diff options
author | Paul Phillips <paulp@improving.org> | 2012-12-20 14:56:16 -0800 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2012-12-20 14:56:16 -0800 |
commit | 15fa9a719810b7481bc35bfda423198da515d025 (patch) | |
tree | 1f3371376c9f91e12521588d3cc29855a706a9a3 /src/compiler | |
parent | 9ddb4cf41f9832e46fa1109d96fc6708c4586c53 (diff) | |
parent | 3a6f3aea9292d590d81d318622a9fbd7c599089d (diff) | |
download | scala-15fa9a719810b7481bc35bfda423198da515d025.tar.gz scala-15fa9a719810b7481bc35bfda423198da515d025.tar.bz2 scala-15fa9a719810b7481bc35bfda423198da515d025.zip |
Merge pull request #1687 from scalamacros/topic/unchecked-pattern-match
fixes the unchecked warning in quick.comp
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala b/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala index 6abb52a649..60399f53bf 100644 --- a/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala +++ b/src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala @@ -212,7 +212,11 @@ trait TypeStrings { } private def tparamString[T: ru.TypeTag] : String = { - def typeArguments: List[ru.Type] = ru.typeOf[T] match { case ru.TypeRef(_, _, args) => args; case _ => Nil } + def typeArguments: List[ru.Type] = { + import ru.TypeRefTag // otherwise the pattern match will be unchecked + // because TypeRef is an abstract type + ru.typeOf[T] match { case ru.TypeRef(_, _, args) => args; case _ => Nil } + } // [Eugene to Paul] 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)) |