From b5bfd06624174090c95e230f1a62b092352c95b8 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Tue, 15 Oct 2024 13:17:26 +0100 Subject: [PATCH] Kotlin: Fix for 2.1.0-Beta2 We need to catch a different exception now. --- .../src/main/kotlin/KotlinFileExtractor.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt index 574e11c21b9d..45583dbf55b9 100644 --- a/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt +++ b/java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt @@ -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) }