KAPT+IR: Properly process annotations and backing field annotations
This commit is contained in:
@@ -52,7 +52,7 @@ abstract class IrBasedDeclarationDescriptor<T : IrDeclaration>(val owner: T) : D
|
||||
symbol.owner.valueParameters.map { it.name to getValueArgument(it.index) }
|
||||
.filter { it.second != null }
|
||||
.associate { it.first to it.second!!.toConstantValue() },
|
||||
/*TODO*/ SourceElement.NO_SOURCE
|
||||
source
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,15 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol
|
||||
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
|
||||
|
||||
abstract class IrConstructorCall : IrFunctionAccessExpression() {
|
||||
abstract override val symbol: IrConstructorSymbol
|
||||
|
||||
abstract val source: SourceElement
|
||||
|
||||
abstract val constructorTypeArgumentsCount: Int
|
||||
|
||||
override fun <R, D> accept(visitor: IrElementVisitor<R, D>, data: D): R =
|
||||
|
||||
+2
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.ir.expressions.impl
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.UNDEFINED_OFFSET
|
||||
import org.jetbrains.kotlin.ir.expressions.IrConstructorCall
|
||||
@@ -23,6 +24,7 @@ class IrConstructorCallImpl(
|
||||
override val constructorTypeArgumentsCount: Int,
|
||||
valueArgumentsCount: Int,
|
||||
override val origin: IrStatementOrigin? = null,
|
||||
override val source: SourceElement = SourceElement.NO_SOURCE
|
||||
) : IrConstructorCall() {
|
||||
override val typeArgumentsByIndex: Array<IrType?> = arrayOfNulls(typeArgumentsCount)
|
||||
|
||||
|
||||
@@ -170,7 +170,8 @@ abstract class ConstantValueGenerator(
|
||||
primaryConstructorSymbol,
|
||||
valueArgumentsCount = primaryConstructorDescriptor.valueParameters.size,
|
||||
typeArgumentsCount = annotationClassDescriptor.declaredTypeParameters.size,
|
||||
constructorTypeArgumentsCount = 0
|
||||
constructorTypeArgumentsCount = 0,
|
||||
source = annotationDescriptor.source
|
||||
)
|
||||
|
||||
val substitutor = TypeConstructorSubstitution.create(annotationType).buildSubstitutor()
|
||||
|
||||
Reference in New Issue
Block a user