Don't report warning about changing execution order for varargs if it's inside an annotation

^KT-43110 Fixed
This commit is contained in:
Victor Petukhov
2020-11-03 16:18:20 +03:00
parent f052bc341c
commit 90ea64a0e5
12 changed files with 108 additions and 10 deletions
@@ -12,12 +12,15 @@ import org.jetbrains.kotlin.psi.KtValueArgument
import org.jetbrains.kotlin.resolve.calls.callUtil.getParameterForArgument
import org.jetbrains.kotlin.resolve.calls.components.isVararg
import org.jetbrains.kotlin.resolve.calls.model.*
import org.jetbrains.kotlin.resolve.descriptorUtil.isAnnotationConstructor
object VarargWrongExecutionOrderChecker : CallChecker {
override fun check(resolvedCall: ResolvedCall<*>, reportOn: PsiElement, context: CallCheckerContext) {
val isCorrectExecutionOrderForVarargArgumentsAlreadyUsed =
context.languageVersionSettings.getFeatureSupport(LanguageFeature.UseCorrectExecutionOrderForVarargArguments) == LanguageFeature.State.ENABLED
if (resolvedCall.candidateDescriptor.isAnnotationConstructor()) return
if (isCorrectExecutionOrderForVarargArgumentsAlreadyUsed) return
val valueArguments = resolvedCall.call.valueArguments