diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/components/TypeUsage.java b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/components/TypeUsage.java index d4d370b6c48..310435314bd 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/components/TypeUsage.java +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/components/TypeUsage.java @@ -23,7 +23,6 @@ package org.jetbrains.kotlin.load.java.components; public enum TypeUsage { MEMBER_SIGNATURE_COVARIANT, MEMBER_SIGNATURE_CONTRAVARIANT, - MEMBER_SIGNATURE_INVARIANT, SUPERTYPE, COMMON } diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaAnnotationDescriptor.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaAnnotationDescriptor.kt index 09ac8a0d061..8bd15b63fc2 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaAnnotationDescriptor.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaAnnotationDescriptor.kt @@ -132,7 +132,7 @@ class LazyJavaAnnotationDescriptor( // Class type is never nullable in 'Foo.class' in Java val type = TypeUtils.makeNotNullable(c.typeResolver.transformJavaType( javaType, - TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes(allowFlexible = false)) + TypeUsage.COMMON.toAttributes(allowFlexible = false)) ) val jlClass = c.module.resolveTopLevelClass(FqName("java.lang.Class"), NoLookupLocation.FOR_NON_TRACKED_SCOPE) ?: return null diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt index e5082713c25..59bd52dfc87 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaClassMemberScope.kt @@ -561,7 +561,7 @@ class LazyJavaClassMemberScope( val methods = jClass.methods val result = ArrayList(methods.size) - val attr = TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes(allowFlexible = false, isForAnnotationParameter = true) + val attr = TypeUsage.COMMON.toAttributes(allowFlexible = false, isForAnnotationParameter = true) val (methodsNamedValue, otherMethods) = methods. partition { it.name == JvmAnnotationNames.DEFAULT_ANNOTATION_MEMBER_NAME } diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt index 64a1de87b5c..b2e70215e99 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/descriptors/LazyJavaScope.kt @@ -286,7 +286,7 @@ abstract class LazyJavaScope(protected val c: LazyJavaResolverContext) : MemberS val allowFlexible = !(field.isFinalStatic && field.hasConstantNotNullInitializer) val propertyType = c.typeResolver.transformJavaType( field.type, - LazyJavaTypeAttributes(TypeUsage.MEMBER_SIGNATURE_INVARIANT, annotations, allowFlexible) + LazyJavaTypeAttributes(TypeUsage.COMMON, annotations, allowFlexible) ) if (!allowFlexible) { return TypeUtils.makeNotNullable(propertyType) diff --git a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/RawType.kt b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/RawType.kt index 8f52dc0d5ee..407bde4d35b 100644 --- a/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/RawType.kt +++ b/core/descriptor.loader.java/src/org/jetbrains/kotlin/load/java/lazy/types/RawType.kt @@ -85,9 +85,9 @@ class RawTypeImpl(lowerBound: SimpleType, upperBound: SimpleType) : FlexibleType internal object RawSubstitution : TypeSubstitution() { override fun get(key: KotlinType) = TypeProjectionImpl(eraseType(key)) - private val lowerTypeAttr = TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes() + private val lowerTypeAttr = TypeUsage.COMMON.toAttributes() .computeAttributes(allowFlexible = false, isRaw = true, forLower = true) - private val upperTypeAttr = TypeUsage.MEMBER_SIGNATURE_INVARIANT.toAttributes() + private val upperTypeAttr = TypeUsage.COMMON.toAttributes() .computeAttributes(allowFlexible = false, isRaw = true, forLower = false) fun eraseType(type: KotlinType): KotlinType {