FIR Java annotations: create vararg or Array depending on parameter name

#KT-42346 Fixed
This commit is contained in:
Mikhail Glukhikh
2020-10-05 15:58:23 +03:00
parent f6b49a2c9a
commit 64fb114c30
2 changed files with 4 additions and 4 deletions
@@ -21,7 +21,7 @@ FILE: kt42346.kt
}
}
@R|MagicConstant|(vararg(intValues = <implicitArrayOf>(Q|StepRequest|.R|/StepRequest.Companion.STEP_INTO|.R|kotlin/Int.toLong|(), Q|StepRequest|.R|/StepRequest.Companion.STEP_OVER|.R|kotlin/Int.toLong|(), Q|StepRequest|.R|/StepRequest.Companion.STEP_OUT|.R|kotlin/Int.toLong|()))) public final val depth: R|kotlin/Int| = Int(42)
@R|MagicConstant|(intValues = <implicitArrayOf>(Q|StepRequest|.R|/StepRequest.Companion.STEP_INTO|.R|kotlin/Int.toLong|(), Q|StepRequest|.R|/StepRequest.Companion.STEP_OVER|.R|kotlin/Int.toLong|(), Q|StepRequest|.R|/StepRequest.Companion.STEP_OUT|.R|kotlin/Int.toLong|())) public final val depth: R|kotlin/Int| = Int(42)
public get(): R|kotlin/Int|
public final annotation class KotlinMagicConstant : R|kotlin/Annotation| {
public constructor(intValues: R|kotlin/LongArray|): R|KotlinMagicConstant| {
@@ -369,13 +369,13 @@ class JavaSymbolProvider(
val parameterForAnnotationConstructor = buildJavaValueParameter {
session = this@JavaSymbolProvider.session
returnTypeRef = firJavaMethod.returnTypeRef
name = firJavaMethod.name
name = methodName
if (javaMethod.hasAnnotationParameterDefaultValue) {
defaultValue = buildExpressionStub()
}
isVararg = javaMethod.returnType is JavaArrayType
isVararg = returnType is JavaArrayType && methodName == VALUE_METHOD_NAME
}
if (firJavaMethod.name == VALUE_METHOD_NAME) {
if (methodName == VALUE_METHOD_NAME) {
valueParametersForAnnotationConstructor.valueParameterForValue = parameterForAnnotationConstructor
} else {
valueParametersForAnnotationConstructor.valueParameters += parameterForAnnotationConstructor