[NI] Support assigning single array elements in named form to varargs

This commit is contained in:
Mikhail Zarechenskiy
2017-11-07 12:34:48 +03:00
parent fe2499b47f
commit 519e5c33d8
8 changed files with 46 additions and 16 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -42,6 +42,7 @@ import org.jetbrains.kotlin.types.typeUtil.isAnyOrNullableAny
import org.jetbrains.kotlin.types.typeUtil.makeNullable
import org.jetbrains.kotlin.utils.DFS
import org.jetbrains.kotlin.utils.SmartList
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
fun ClassDescriptor.getClassObjectReferenceTarget(): ClassDescriptor = companionObjectDescriptor ?: this
@@ -433,3 +434,8 @@ fun MemberDescriptor.isEffectivelyExternal(): Boolean {
val containingClass = getContainingClass(this)
return containingClass != null && containingClass.isEffectivelyExternal()
}
fun isParameterOfAnnotation(parameterDescriptor: ParameterDescriptor): Boolean {
val constructedClass = parameterDescriptor.containingDeclaration.safeAs<ConstructorDescriptor>()?.constructedClass
return DescriptorUtils.isAnnotationClass(constructedClass)
}
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2016 JetBrains s.r.o.
* Copyright 2010-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.