Skip to content

Commit b3f8167

Browse files
committed
Kotlin: Don't warn if we can't find a label for a fake owner
The fake owner probably just wasn't extracted
1 parent f111fba commit b3f8167

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ open class KotlinFileExtractor(
205205
}
206206

207207
@OptIn(ObsoleteDescriptorBasedAPI::class)
208-
private fun isFake(d: IrDeclarationWithVisibility): Boolean {
208+
fun isFake(d: IrDeclarationWithVisibility): Boolean {
209209
val hasFakeVisibility =
210210
d.visibility.let {
211211
it is DelegatedDescriptorVisibility && it.delegate == Visibilities.InvisibleFake

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,13 @@ open class CommentExtractor(
4141
tw.getExistingLabelFor<DbTop>(label)
4242
}
4343
if (existingLabel == null) {
44-
logger.warn("Couldn't get existing label for $label")
44+
// Sometimes we don't extract elements.
45+
// The actual extractor logic is a bit more nuanced than
46+
// just "isFake", but just checking isFake is good enough
47+
// to not bother with a warning.
48+
if(element !is IrDeclarationWithVisibility || !fileExtractor.isFake(element)) {
49+
logger.warn("Couldn't get existing label for $label")
50+
}
4551
return null
4652
}
4753
return existingLabel

0 commit comments

Comments
 (0)