Permalink
Browse files

SI-6338 fixes the unchecked warning in quick.comp

All those months when I thought it was yet another spurious error
in the new pattern matcher...
  • Loading branch information...
1 parent f50131d commit 3a6f3aea9292d590d81d318622a9fbd7c599089d @xeno-by xeno-by committed Nov 30, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 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))

0 comments on commit 3a6f3ae

Please sign in to comment.