vendredi 3 août 2018

How to get the declaring Type of a Method by MethodSymbol?

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