I want to find out the actual Type that defines the method in a sub type. E.g.:
typeOf[List[_]].decl(TermName("map")).asMethod.?declaringType?
as in Java you can get call Method::getDeclaringClass
to get the Class that declared the method. How can I achieve this in Scala? I checked both info
and typeSignature
and they only contain the method signature but no enclosing class info.
Aucun commentaire:
Enregistrer un commentaire