You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt
+9-3Lines changed: 9 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -526,8 +526,14 @@ open class KotlinFileExtractor(
526
526
}
527
527
}
528
528
529
+
/**
530
+
* This function traverses the declaration-parent hierarchy upwards, and retrieves the enclosing class of a class to extract the `enclInReftype` relation.
531
+
* Additionally, it extracts a companion field for a companion object into its parent class.
532
+
*
533
+
* Note that the nested class can also be a local class declared inside a function, so the upwards traversal is skipping the non-class parents. Also, in some cases the file class is the enclosing one, which has no IR representation.
534
+
*/
529
535
privatefunextractEnclosingClass(
530
-
declarationParent:IrDeclarationParent, // The declaration parent if the element for which we are extracting the enclosing class
536
+
declarationParent:IrDeclarationParent, // The declaration parent of the element for which we are extracting the enclosing class
531
537
innerId:Label<outDbClassorinterface>, // ID of the inner class
532
538
innerClass:IrClass?, // The inner class, if available. It's not available if the enclosing class of a generated class is being extracted
533
539
innerLocId:Label<DbLocation>, // Location of the inner class
@@ -544,7 +550,7 @@ open class KotlinFileExtractor(
0 commit comments