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.
This commit is contained in:
Chris Smowton
2022-06-21 16:18:37 +01:00
parent 2b2c384933
commit 8c57308661

View File

@@ -86,6 +86,7 @@ open class KotlinFileExtractor(
}
}
@OptIn(ObsoleteDescriptorBasedAPI::class)
private fun isFake(d: IrDeclarationWithVisibility): Boolean {
val visibility = d.visibility
if (visibility is DelegatedDescriptorVisibility && visibility.delegate == Visibilities.InvisibleFake) {
@@ -94,6 +95,9 @@ open class KotlinFileExtractor(
if (d.isFakeOverride) {
return true
}
if ((d as? IrFunction)?.descriptor?.isHiddenToOvercomeSignatureClash == true) {
return true
}
return false
}