Skip to content

Commit 8c57308

Browse files
committed
Prevent extracting hidden functions
I'm not sure how these looked in 1.6 and below yet, but in 1.7 they appear with visibility = public, but a descriptor field set to indicate they have a name clash with a 'real' function.
1 parent 2b2c384 commit 8c57308

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
@@ -86,6 +86,7 @@ open class KotlinFileExtractor(
8686
}
8787
}
8888

89+
@OptIn(ObsoleteDescriptorBasedAPI::class)
8990
private fun isFake(d: IrDeclarationWithVisibility): Boolean {
9091
val visibility = d.visibility
9192
if (visibility is DelegatedDescriptorVisibility && visibility.delegate == Visibilities.InvisibleFake) {
@@ -94,6 +95,9 @@ open class KotlinFileExtractor(
9495
if (d.isFakeOverride) {
9596
return true
9697
}
98+
if ((d as? IrFunction)?.descriptor?.isHiddenToOvercomeSignatureClash == true) {
99+
return true
100+
}
97101
return false
98102
}
99103

0 commit comments

Comments
 (0)