Scala reflection error: this is an inner module, use reflectModule on an InstanceMirror to obtain its ModuleMirror
问题 Following up on this question, I'm trying to figure out how to call a method on an object. The relevant definitions are: trait ThirdParty { def invoke = println("right") } trait WeatherIcon { def invoke = println("wrong") } class MyClass { object objA extends ThirdParty object objB extends WeatherIcon } I got a Symbol for objA like this: import reflect.runtime.universe._ val stuff = typeOf[MyClass].members.filter(_.isValue).filter(_.typeSignature <:< typeOf[ThirdParty]) That returns an