Skip to content

Commit b79d273

Browse files
committed
When calling a $default method, ensure the real method gets extracted
1 parent 3452dcb commit b79d273

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1718,6 +1718,10 @@ open class KotlinFileExtractor(
17181718
extensionReceiver: IrExpression?
17191719
) {
17201720
val callTarget = syntacticCallTarget.target.realOverrideTarget
1721+
if (isExternalDeclaration(callTarget)) {
1722+
// Ensure the real target gets extracted, as we might not every directly touch it thanks to this call being redirected to a $default method.
1723+
useFunction<DbCallable>(callTarget)
1724+
}
17211725
val defaultMethodLabel = getDefaultsMethodLabel(callTarget)
17221726
val id = extractMethodAccessWithoutArgs(callsite.type, locId, enclosingCallable, callsiteParent, childIdx, enclosingStmt, defaultMethodLabel)
17231727

0 commit comments

Comments
 (0)