How to get to type parameters of a reflect.runtime.universe.Type in scala? [duplicate]
问题 This question already has answers here : Finding type parameters via reflection in Scala 2.10? (2 answers) Closed 5 years ago . Suppose I get a Type representing List[Int]: > import scala.reflect.runtime.universe > val mirror = universe.runtimeMirror(this.getClass.getClassLoader) mirror: reflect.runtime.universe.Mirror = JavaMirror with ... > class X{ def getList():List[Int] = null } defined class X > val method = mirror. classSymbol(classOf[X]). toType. declarations. filter{_.isMethod}. map{