Skip to content

Commit

Permalink
Kotlin: Fix for 2.1.0-Beta2
Browse files Browse the repository at this point in the history
We need to catch a different exception now.
  • Loading branch information
igfoo committed Oct 15, 2024
1 parent f1a350c commit b5bfd06
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,17 @@ open class KotlinFileExtractor(
}

private fun FunctionDescriptor.tryIsHiddenToOvercomeSignatureClash(d: IrFunction): Boolean {
// `org.jetbrains.kotlin.ir.descriptors.IrBasedClassConstructorDescriptor.isHiddenToOvercomeSignatureClash`
// throws one exception or other in Kotlin 2, depending on the version.
// TODO: We need a replacement for this for Kotlin 2
try {
return this.isHiddenToOvercomeSignatureClash
} catch (e: NotImplementedError) {
// `org.jetbrains.kotlin.ir.descriptors.IrBasedClassConstructorDescriptor.isHiddenToOvercomeSignatureClash` throws the exception
// TODO: We need a replacement for this for Kotlin 2
if (!usesK2) {
logger.warnElement("Couldn't query if element is fake, deciding it's not.", d, e)
}
return false
} catch (e: IllegalStateException) {
if (!usesK2) {
logger.warnElement("Couldn't query if element is fake, deciding it's not.", d, e)
}
Expand Down

0 comments on commit b5bfd06

Please sign in to comment.