Consider the following code:
class Foo(var name: String = \"bar\")
Now i try to get the value and the correct type of it via reflection:
foo.getClass.getDeclaredField("name").getString(foo)
should work if you want to avoid asInstanceOf. get* is available for various types
asInstanceOf
get*