Skip to content

Commit

Permalink
Merge pull request #1687 from scalamacros/topic/unchecked-pattern-match
Browse files Browse the repository at this point in the history
fixes the unchecked warning in quick.comp
  • Loading branch information
paulp committed Dec 20, 2012
2 parents 9ddb4cf + 3a6f3ae commit 15fa9a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala
Expand Up @@ -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))
Expand Down

0 comments on commit 15fa9a7

Please sign in to comment.