Accepted answer

Use _.typeSignature.typeArgs.head, because String is a type argument of String*, not its typeSymbol.


Your parameter x is type of String*. That is what you get by calling:


but String* is intrepreted as Seq[String] (as we all know). Thus calling:


will get you your type arguments, i.e. your desired String. Btw. if you want to prove that String* is Seq just call:


So your modified code should look like (omitting class C):

val c = C()
val r = runtimeMirror(getClass.getClassLoader).reflect(c)
val x = r.symbol.typeSignature.member(newTermName("f"))
val params = {
for (param <- params) {

it will print List(String).


Related Query

More Query from same tag