Skip to content

Commit 81cf4c3

Browse files
committed
Only get existing local function labels
1 parent c77f573 commit 81cf4c3

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,14 @@ open class KotlinUsesExtractor(
11621162
return res
11631163
}
11641164

1165+
fun getExistingLocallyVisibleFunctionLabel(f: IrFunction): Label<DbMethod>? {
1166+
if (!f.isLocalFunction()){
1167+
return null
1168+
}
1169+
1170+
return tw.lm.locallyVisibleFunctionLabelMapping[f]?.function
1171+
}
1172+
11651173
// These are classes with Java equivalents, but whose methods don't all exist on those Java equivalents--
11661174
// for example, the numeric classes define arithmetic functions (Int.plus, Long.or and so on) that lower to
11671175
// primitive arithmetic on the JVM, but which we extract as calls to reflect the source syntax more closely.

java/kotlin-extractor/src/main/kotlin/comments/CommentExtractor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class CommentExtractor(private val fileExtractor: KotlinFileExtractor, private v
107107
tw.getExistingVariableLabelFor(ownerIr)
108108
} else if (ownerIr is IrFunction && ownerIr.isLocalFunction()) {
109109
label = "local function ${ownerIr.name.asString()}"
110-
fileExtractor.getLocallyVisibleFunctionLabels(ownerIr).function
110+
fileExtractor.getExistingLocallyVisibleFunctionLabel(ownerIr)
111111
}
112112
else {
113113
label = getLabel(ownerIr) ?: continue

0 commit comments

Comments
 (0)