:wave: I’m looking for a means to identify the own...
# compiler
t
👋 I’m looking for a means to identify the owner of a class, property, or method. I’ve looked through the
ConeKotlinType
,
Symbol
, and
FirElement
, but I haven’t found anything that sticks out. Essentially, while type attributing an inner class, class property, or method, I’d like to add the owner to the type attribution. Is there a way to access the info that I am overlooking? Also, in the case of a function or property declared at the
<root>,
is it possible to access the file instead?
d
For callables (properties and functions) you can use this utility For classes you can just determine containing class by
classId
Copy code
val parentClassSymbol = firClass.classId.outerClassId?.let { session.symbolProvider.getClassLikeSymbolByClassId(it) }