Kotlin 2: isFake is currently broken, so assume not fake for now

We'll want to find a Kotlin-2-compatible replacement for this.
This commit is contained in:
Ian Lynagh
2023-11-21 14:37:53 +00:00
parent 6bd269502f
commit 1998e29639

View File

@@ -80,6 +80,7 @@ open class KotlinFileExtractor(
globalExtensionState: KotlinExtractorGlobalState,
): KotlinUsesExtractor(logger, tw, dependencyCollector, externalClassExtractor, primitiveTypeMapping, pluginContext, globalExtensionState) {
val usesK2 = usesK2(pluginContext)
val metaAnnotationSupport = MetaAnnotationSupport(logger, pluginContext, this)
private inline fun <T> with(kind: String, element: IrElement, f: () -> T): T {
@@ -172,7 +173,10 @@ open class KotlinFileExtractor(
}
catch (e: NotImplementedError) {
// `org.jetbrains.kotlin.ir.descriptors.IrBasedClassConstructorDescriptor.isHiddenToOvercomeSignatureClash` throws the exception
logger.warnElement("Couldn't query if element is fake, deciding it's not.", d, e)
// 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
}
}