Skip to content

Commit 3a6f3ae

Browse files
committed
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...
1 parent f50131d commit 3a6f3ae

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,11 @@ trait TypeStrings {
212212
}
213213

214214
private def tparamString[T: ru.TypeTag] : String = {
215-
def typeArguments: List[ru.Type] = ru.typeOf[T] match { case ru.TypeRef(_, _, args) => args; case _ => Nil }
215+
def typeArguments: List[ru.Type] = {
216+
import ru.TypeRefTag // otherwise the pattern match will be unchecked
217+
// because TypeRef is an abstract type
218+
ru.typeOf[T] match { case ru.TypeRef(_, _, args) => args; case _ => Nil }
219+
}
216220
// [Eugene to Paul] need to use not the `rootMirror`, but a mirror with the REPL's classloader
217221
// how do I get to it? acquiring context classloader seems unreliable because of multithreading
218222
def typeVariables: List[java.lang.Class[_]] = typeArguments map (targ => ru.rootMirror.runtimeClass(targ))

0 commit comments

Comments
 (0)