Revert "Load annotation parameter's type for ctr as contravariant"

This reverts commit 294eb1dceb.
This commit is contained in:
Denis Zharkov
2015-06-09 16:04:19 +03:00
parent 2df6fcb785
commit 9080b57635
5 changed files with 11 additions and 20 deletions
@@ -225,16 +225,7 @@ public class LazyJavaClassMemberScope(
val methods = jClass.getMethods()
val result = ArrayList<ValueParameterDescriptor>(methods.size())
// Using MEMBER_SIGNATURE_CONTRAVARIANT is just a hack to make overload resolution work in cases like
// Ann(arg = array(javaClass<Int>())) class Annotated
//
// If we load constructor parameters' types as invariant: Ann(arg: Array<Class<*>>), Ann(arg: Array<KClass<*>>), then
// when resolving `Ann(arg = array(javaClass<Int>()))` type of array is inferred as Array<Class<Int>>
// which is neither subtype of Array<Class<*>> nor Array<KClass<*>> (similar case is KT-7410)
//
// Hack should be removed if support of Class<*> in annotations is dropped or KT-7410 is fixed
// Also see tests `AnnotationsWithClassParameterOverload`
val attr = TypeUsage.MEMBER_SIGNATURE_CONTRAVARIANT.toAttributes(
val attr = TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes(
allowFlexible = false, isForAnnotationParameter = loadJavaClassAsKClass)
val (methodsNamedValue, otherMethods) = methods.