blob: 2600847d9932256f5ef235a890fbda7a871aca97 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
Type in expressions to have them evaluated.
Type :help for more information.
scala>
scala> import scala.reflect.runtime.universe._
import scala.reflect.runtime.universe._
scala> class A { def foo(x: Int*) = 1 }
defined class A
scala> val sig = typeOf[A] member newTermName("foo") typeSignature
warning: there were 1 feature warnings; re-run with -feature for details
sig: reflect.runtime.universe.Type = (x: <?>)scala.Int
scala> val x = sig.asInstanceOf[MethodType].params.head
x: reflect.runtime.universe.Symbol = value x
scala> println(x.typeSignature)
scala.Int*
scala>
|