[FIR2IR] Return fallback mode for annotation resolved placeholder
This commit is contained in:
+13
@@ -18,6 +18,7 @@ import org.jetbrains.kotlin.fir.references.FirReference
|
||||
import org.jetbrains.kotlin.fir.references.FirResolvedNamedReference
|
||||
import org.jetbrains.kotlin.fir.references.FirSuperReference
|
||||
import org.jetbrains.kotlin.fir.render
|
||||
import org.jetbrains.kotlin.fir.resolve.buildUseSiteMemberScope
|
||||
import org.jetbrains.kotlin.fir.resolve.calls.isFunctional
|
||||
import org.jetbrains.kotlin.fir.resolve.inference.isBuiltinFunctionalType
|
||||
import org.jetbrains.kotlin.fir.resolve.inference.isSuspendFunctionType
|
||||
@@ -428,6 +429,18 @@ class CallAndReferenceGenerator(
|
||||
val irClass = symbol.owner
|
||||
val irConstructor = (annotationCall.toResolvedCallableSymbol() as? FirConstructorSymbol)?.let {
|
||||
this.declarationStorage.getIrConstructorSymbol(it)
|
||||
} ?: run {
|
||||
// Fallback for FirReferencePlaceholderForResolvedAnnotations from jar
|
||||
val fir = coneType.lookupTag.toSymbol(session)?.fir as? FirClass<*>
|
||||
var constructorSymbol: FirConstructorSymbol? = null
|
||||
fir?.buildUseSiteMemberScope(session, scopeSession)?.processDeclaredConstructors {
|
||||
if (it.fir.isPrimary && constructorSymbol == null) {
|
||||
constructorSymbol = it
|
||||
}
|
||||
}
|
||||
constructorSymbol?.let {
|
||||
this.declarationStorage.getIrConstructorSymbol(it)
|
||||
}
|
||||
}
|
||||
if (irConstructor == null) {
|
||||
IrErrorCallExpressionImpl(startOffset, endOffset, type, "No annotation constructor found: ${irClass.name}")
|
||||
|
||||
-1
@@ -1,6 +1,5 @@
|
||||
// KOTLIN_CONFIGURATION_FLAGS: +JVM.EMIT_JVM_TYPE_ANNOTATIONS
|
||||
// TARGET_BACKEND: JVM
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// JVM_TARGET: 1.8
|
||||
// WITH_REFLECT
|
||||
// FULL_JDK
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +PolymorphicSignature
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// SKIP_JDK6
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +PolymorphicSignature
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// SKIP_JDK6
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +PolymorphicSignature
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// SKIP_JDK6
|
||||
|
||||
-1
@@ -1,5 +1,4 @@
|
||||
// !LANGUAGE: +PolymorphicSignature
|
||||
// IGNORE_BACKEND_FIR: JVM_IR
|
||||
// TARGET_BACKEND: JVM
|
||||
// FULL_JDK
|
||||
// SKIP_JDK6
|
||||
|
||||
Reference in New Issue
Block a user