[K/N] Fix for instantiating annotations from already lowered file
If annotation class is already lowered, it can have more than one constructor. So we should use primary one, not any one. ^KT-53475
This commit is contained in:
+1
@@ -69,6 +69,7 @@ abstract class AnnotationImplementationTransformer(val context: BackendContext,
|
||||
val constructedClass = expression.type.classOrNull?.owner ?: return super.visitConstructorCall(expression)
|
||||
if (!constructedClass.isAnnotationClass) return super.visitConstructorCall(expression)
|
||||
if (constructedClass.typeParameters.isNotEmpty()) return super.visitConstructorCall(expression) // Not supported yet
|
||||
require(expression.symbol.owner.isPrimary) { "Non-primary constructors of annotations are not supported" }
|
||||
|
||||
val implClass = implementations.getOrPut(constructedClass) { createAnnotationImplementation(constructedClass) }
|
||||
val ctor = chooseConstructor(implClass, expression)
|
||||
|
||||
Reference in New Issue
Block a user