score:0

figured it out.

just needed to use m.typesignature

for (m <- typeof[account].members.filter(m => !m.ismethod)) {
     | println(m)
     | println(m.typesignature)
     | }
variable accountnumber
string
variable name
string

score:8

you can use typesignature:

scala> typeof[account].members.filter(!_.ismethod).foreach(
 |   sym => println(sym + " is a " + sym.typesignature)
 | )
variable accountnumber is a string
variable name is a string

in this context this method will return a reflect.runtime.universe.type.


Related Query

More Query from same tag