scalaj-reflect icon indicating copy to clipboard operation
scalaj-reflect copied to clipboard

Can't get the class of inner classes

Open freewind opened this issue 13 years ago • 1 comments

Suppose there is a class with an inner class:

class Out {
    class In {
        def foo(name:String) = ""
    }
}

I have get the method of Out.In.foo, and I want to get the parameter names of it:

for {
    clazz <- Mirror.ofClass(method.getDeclaringClass).toSeq
    method <- clazz.allDefs.find(_.name == method.getName).toSeq
    param <- method.flatParams
} yield (param.name, param.symType.toString)

But seems can't find that inner class:

Mirror.ofClass(method.getDeclaringClass).toSeq

returns a List()

freewind avatar Mar 22 '11 13:03 freewind

I won't work at the moment, this is on the backlog.

kevinwright avatar May 29 '11 12:05 kevinwright