Skip to content

Commit b5bfd06

Browse files
committed
Kotlin: Fix for 2.1.0-Beta2
We need to catch a different exception now.
1 parent f1a350c commit b5bfd06

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,11 +169,17 @@ open class KotlinFileExtractor(
169169
}
170170

171171
private fun FunctionDescriptor.tryIsHiddenToOvercomeSignatureClash(d: IrFunction): Boolean {
172+
// `org.jetbrains.kotlin.ir.descriptors.IrBasedClassConstructorDescriptor.isHiddenToOvercomeSignatureClash`
173+
// throws one exception or other in Kotlin 2, depending on the version.
174+
// TODO: We need a replacement for this for Kotlin 2
172175
try {
173176
return this.isHiddenToOvercomeSignatureClash
174177
} catch (e: NotImplementedError) {
175-
// `org.jetbrains.kotlin.ir.descriptors.IrBasedClassConstructorDescriptor.isHiddenToOvercomeSignatureClash` throws the exception
176-
// TODO: We need a replacement for this for Kotlin 2
178+
if (!usesK2) {
179+
logger.warnElement("Couldn't query if element is fake, deciding it's not.", d, e)
180+
}
181+
return false
182+
} catch (e: IllegalStateException) {
177183
if (!usesK2) {
178184
logger.warnElement("Couldn't query if element is fake, deciding it's not.", d, e)
179185
}

0 commit comments

Comments
 (0)