diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt index a5cd2182cf5..e021c858d04 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/JavaUtils.kt @@ -62,33 +62,6 @@ import java.lang.annotation.Documented import java.lang.annotation.Retention import java.lang.annotation.Target import java.util.* -import kotlin.Any -import kotlin.Array -import kotlin.Boolean -import kotlin.BooleanArray -import kotlin.Byte -import kotlin.ByteArray -import kotlin.Char -import kotlin.CharArray -import kotlin.Double -import kotlin.DoubleArray -import kotlin.Float -import kotlin.FloatArray -import kotlin.Int -import kotlin.IntArray -import kotlin.Long -import kotlin.LongArray -import kotlin.Short -import kotlin.ShortArray -import kotlin.String -import kotlin.Suppress -import kotlin.also -import kotlin.arrayOf -import kotlin.emptyArray -import kotlin.error -import kotlin.let -import kotlin.run -import kotlin.to internal val JavaModifierListOwner.modality: Modality get() = when { @@ -157,7 +130,7 @@ internal fun JavaClassifierType.toFirResolvedTypeRef( ): FirResolvedTypeRef { val coneType = if (isForSupertypes) - toConeKotlinTypeForFlexibleBound(session, javaTypeParameterStack, isLowerBound = true, forTypeParameterBounds, isForSupertypes) + toConeKotlinTypeForFlexibleBound(session, javaTypeParameterStack, forTypeParameterBounds, isForSupertypes) else toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack, forTypeParameterBounds, isForSupertypes) @@ -171,9 +144,15 @@ internal fun JavaType?.toConeKotlinTypeWithoutEnhancement( session: FirSession, javaTypeParameterStack: JavaTypeParameterStack, forAnnotationMember: Boolean = false, - isForSupertypes: Boolean = false, - attributes: ConeAttributes = ConeAttributes.Empty + isForSupertypes: Boolean = false ): ConeKotlinType { + val attributes = if (this != null && annotations.isNotEmpty()) { + ConeAttributes.create( + listOf(CustomAnnotationTypeAttribute(annotations.map { it.toFirAnnotationCall(session, javaTypeParameterStack) })) + ) + } else { + ConeAttributes.Empty + } return when (this) { is JavaClassifierType -> { toConeKotlinTypeWithoutEnhancement( @@ -206,14 +185,10 @@ internal fun JavaType?.toConeKotlinTypeWithoutEnhancement( bound?.toConeKotlinTypeWithoutEnhancement( session, javaTypeParameterStack, - isForSupertypes = isForSupertypes, - attributes = attributes - ) ?: run { - StandardClassIds.Any.toConeFlexibleType(emptyArray()) - } - null -> { - StandardClassIds.Any.toConeFlexibleType(emptyArray()) - } + isForSupertypes = isForSupertypes + ) ?: StandardClassIds.Any.toConeFlexibleType(emptyArray(), attributes = attributes) + null -> + StandardClassIds.Any.toConeFlexibleType(emptyArray(), attributes = attributes) else -> error("Strange JavaType: ${this::class.java}") } } @@ -257,11 +232,7 @@ private fun ClassId.toConeFlexibleType( typeArgumentsForUpper: Array = typeArguments, attributes: ConeAttributes = ConeAttributes.Empty ) = ConeFlexibleType( - toConeKotlinType( - typeArguments, - isNullable = false, - attributes - ), + toConeKotlinType(typeArguments, isNullable = false, attributes), toConeKotlinType(typeArgumentsForUpper, isNullable = true, attributes) ) @@ -276,7 +247,6 @@ private fun JavaClassifierType.toConeKotlinTypeWithoutEnhancement( val lowerBound = toConeKotlinTypeForFlexibleBound( session, javaTypeParameterStack, - isLowerBound = true, forTypeParameterBounds, isForSupertypes, forAnnotationMember = forAnnotationMember, @@ -289,7 +259,6 @@ private fun JavaClassifierType.toConeKotlinTypeWithoutEnhancement( toConeKotlinTypeForFlexibleBound( session, javaTypeParameterStack, - isLowerBound = false, forTypeParameterBounds, isForSupertypes, lowerBound, @@ -398,7 +367,6 @@ private fun getErasedVersionOfFirstUpperBound( private fun JavaClassifierType.toConeKotlinTypeForFlexibleBound( session: FirSession, javaTypeParameterStack: JavaTypeParameterStack, - isLowerBound: Boolean, forTypeParameterBounds: Boolean, isForSupertypes: Boolean, lowerBound: ConeLookupTagBasedType? = null, @@ -414,15 +382,13 @@ private fun JavaClassifierType.toConeKotlinTypeForFlexibleBound( JavaToKotlinClassMap.mapJavaToKotlin(classifier.fqName!!) } ?: classifier.classId!! - if (isLowerBound || argumentsMakeSenseOnlyForMutableContainer(classId, session)) { + if (lowerBound == null || argumentsMakeSenseOnlyForMutableContainer(classId, session)) { classId = classId.readOnlyToMutable() ?: classId } val lookupTag = ConeClassLikeLookupTagImpl(classId) - if (!isLowerBound && !isRaw && lookupTag == lowerBound?.lookupTag) { - return lookupTag.constructClassType( - lowerBound.typeArguments, isNullable = true - ) + if (lookupTag == lowerBound?.lookupTag && !isRaw) { + return lookupTag.constructClassType(lowerBound.typeArguments, isNullable = true, attributes) } val mappedTypeArguments = if (isRaw) { @@ -433,7 +399,7 @@ private fun JavaClassifierType.toConeKotlinTypeForFlexibleBound( // to create a proper raw type arguments, we should take class parameters some time defaultArgs } else { - val position = if (isLowerBound) TypeComponentPosition.FLEXIBLE_LOWER else TypeComponentPosition.FLEXIBLE_UPPER + val position = if (lowerBound == null) TypeComponentPosition.FLEXIBLE_LOWER else TypeComponentPosition.FLEXIBLE_UPPER val classSymbol = session.symbolProvider.getClassLikeSymbolByFqName(classId) as? FirRegularClassSymbol classSymbol?.fir?.createRawArguments(session, defaultArgs, position) ?: defaultArgs @@ -453,19 +419,15 @@ private fun JavaClassifierType.toConeKotlinTypeForFlexibleBound( } } - lookupTag.constructClassType( - mappedTypeArguments.toTypedArray(), isNullable = !isLowerBound, attributes - ) + lookupTag.constructClassType(mappedTypeArguments.toTypedArray(), isNullable = lowerBound != null, attributes) } is JavaTypeParameter -> { val symbol = javaTypeParameterStack[classifier] - ConeTypeParameterTypeImpl(symbol.toLookupTag(), isNullable = !isLowerBound) + ConeTypeParameterTypeImpl(symbol.toLookupTag(), isNullable = lowerBound != null, attributes) } null -> { val classId = ClassId.topLevel(FqName(this.classifierQualifiedName)) - ConeClassLikeLookupTagImpl(classId).constructClassType( - emptyArray(), isNullable = !isLowerBound, attributes, - ) + classId.constructClassLikeType(emptyArray(), isNullable = lowerBound != null, attributes) } else -> ConeKotlinErrorType(ConeSimpleDiagnostic("Unexpected classifier: $classifier", DiagnosticKind.Java)) } @@ -681,9 +643,7 @@ private fun JavaType?.toConeProjectionWithoutEnhancement( } } } - is JavaClassifierType -> toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack, isForSupertypes = isForSupertypes) - is JavaArrayType -> toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack, isForSupertypes = isForSupertypes) - else -> ConeClassErrorType(ConeSimpleDiagnostic("Unexpected type argument: $this", DiagnosticKind.Java)) + else -> toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack, isForSupertypes = isForSupertypes) } } diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/EnhancementSignatureParts.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/EnhancementSignatureParts.kt index 9e5bd544fde..c920f81a227 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/EnhancementSignatureParts.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/EnhancementSignatureParts.kt @@ -12,16 +12,11 @@ import org.jetbrains.kotlin.fir.declarations.FirValueParameter import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall import org.jetbrains.kotlin.fir.java.JavaTypeParameterStack import org.jetbrains.kotlin.fir.java.toConeKotlinTypeWithoutEnhancement -import org.jetbrains.kotlin.fir.java.toFirJavaTypeRef import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag import org.jetbrains.kotlin.fir.types.* -import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.types.jvm.FirJavaTypeRef import org.jetbrains.kotlin.load.java.AnnotationQualifierApplicabilityType import org.jetbrains.kotlin.load.java.JavaDefaultQualifiers -import org.jetbrains.kotlin.load.java.structure.JavaClassifierType -import org.jetbrains.kotlin.load.java.structure.JavaTypeParameter -import org.jetbrains.kotlin.load.java.structure.JavaWildcardType import org.jetbrains.kotlin.load.java.typeEnhancement.* import org.jetbrains.kotlin.name.FqNameUnsafe import org.jetbrains.kotlin.utils.addToStdlib.safeAs @@ -38,8 +33,6 @@ internal class EnhancementSignatureParts( ) { private val isForVarargParameter get() = typeContainer.safeAs()?.isVararg == true - private val attributesCache = mutableMapOf().withDefault { ConeAttributes.Empty } - private fun ConeKotlinType.toFqNameUnsafe(): FqNameUnsafe? = ((this as? ConeLookupTagBasedType)?.lookupTag as? ConeClassLikeLookupTag)?.classId?.asSingleFqName()?.toUnsafe() @@ -48,7 +41,10 @@ internal class EnhancementSignatureParts( predefined: TypeEnhancementInfo? = null, forAnnotationMember: Boolean = false ): PartEnhancementResult { - val qualifiers = computeIndexedQualifiersForOverride(session) + val typeWithoutEnhancement = current.type + .toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack, forAnnotationMember) + + val qualifiers = computeIndexedQualifiersForOverride(typeWithoutEnhancement) val qualifiersWithPredefined = predefined?.let { IndexedJavaTypeQualifiers(qualifiers.size) { index -> @@ -56,12 +52,6 @@ internal class EnhancementSignatureParts( } } - val typeWithoutEnhancement = current.type.toConeKotlinTypeWithoutEnhancement( - session, - javaTypeParameterStack, - forAnnotationMember, - attributes = attributesCache.getValue(current) - ) val containsFunctionN = typeWithoutEnhancement.contains { if (it is ConeClassErrorType) false else { @@ -87,43 +77,31 @@ internal class EnhancementSignatureParts( } } + private fun FirTypeRef.toConeKotlinType(session: FirSession): ConeKotlinType? = + when (this) { + is FirResolvedTypeRef -> type + is FirJavaTypeRef -> type.toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack) + else -> null + } - private fun FirTypeRef.toIndexed( - typeQualifierResolver: FirAnnotationTypeQualifierResolver, - context: FirJavaEnhancementContext - ): List { + private fun ConeKotlinType?.toIndexed(context: FirJavaEnhancementContext): List { val list = ArrayList(1) - fun add(type: FirTypeRef?) { + fun add(type: ConeKotlinType?) { // TODO: should use the context from parent type - val c = context.copyWithNewDefaultTypeQualifiers(typeQualifierResolver, type?.annotations.orEmpty()) + val annotations = type?.attributes?.customAnnotations.orEmpty() + val c = context.copyWithNewDefaultTypeQualifiers(typeQualifierResolver, annotations) list.add(TypeAndDefaultQualifiers(type, c.defaultTypeQualifiers?.get(AnnotationQualifierApplicabilityType.TYPE_USE))) - - when (type) { - is FirJavaTypeRef -> { - for (arg in type.type.typeArguments()) { - add(arg.takeIf { it !is JavaWildcardType }?.toFirJavaTypeRef(context.session, javaTypeParameterStack)) - } - } - is FirUserTypeRef -> { - for (arg in type.qualifier.lastOrNull()?.typeArgumentList?.typeArguments.orEmpty()) { - add((arg as? FirTypeProjectionWithVariance)?.typeRef) - } - } - is FirResolvedTypeRef -> { - for (arg in type.type.typeArguments) { - add(arg.type?.let { buildResolvedTypeRef { this.type = it } }) - } - } - else -> Unit - } + type?.typeArguments?.forEach { add(it.type) } } add(this) return list } - private fun extractQualifiers(lower: ConeKotlinType, upper: ConeKotlinType): JavaTypeQualifiers { + private fun ConeKotlinType.extractQualifiers(): JavaTypeQualifiers { + val lower = lowerBoundIfFlexible() + val upper = upperBoundIfFlexible() val mapping = JavaToKotlinClassMap return JavaTypeQualifiers( when { @@ -140,29 +118,6 @@ internal class EnhancementSignatureParts( ) } - private fun FirTypeRef.extractQualifiers(session: FirSession): JavaTypeQualifiers { - val (lower, upper) = when (this) { - is FirResolvedTypeRef -> { - val type = this.type - if (type is ConeFlexibleType) { - Pair(type.lowerBound, type.upperBound) - } else { - Pair(type, type) - } - } - is FirJavaTypeRef -> { - val convertedType = type.toConeKotlinTypeWithoutEnhancement(session, javaTypeParameterStack) - Pair( - convertedType.lowerBoundIfFlexible(), - convertedType.upperBoundIfFlexible() - ) - } - else -> return JavaTypeQualifiers.NONE - } - - return extractQualifiers(lower, upper) - } - private fun composeAnnotations(first: List, second: List): List { return when { first.isEmpty() -> second @@ -171,43 +126,35 @@ internal class EnhancementSignatureParts( } } - private fun FirTypeRef?.extractQualifiersFromAnnotations( - isHeadTypeConstructor: Boolean, - defaultQualifiersForType: JavaDefaultQualifiers? - ): JavaTypeQualifiers { - val composedAnnotation = + private fun TypeAndDefaultQualifiers.extractQualifiersFromAnnotations(isHeadTypeConstructor: Boolean): JavaTypeQualifiers { + val annotations = type?.attributes?.customAnnotations.orEmpty() + val composedAnnotations = if (isHeadTypeConstructor && typeContainer != null) - composeAnnotations(typeContainer.annotations, this?.annotations.orEmpty()) + composeAnnotations(typeContainer.annotations, annotations) else - this?.annotations.orEmpty() + annotations val defaultTypeQualifier = if (isHeadTypeConstructor) context.defaultTypeQualifiers?.get(containerApplicabilityType) else - defaultQualifiersForType + defaultQualifiers - val nullabilityInfo = typeQualifierResolver.extractNullability(composedAnnotation).also { - if (it?.qualifier == NullabilityQualifier.NOT_NULL) { - attributesCache[this] = composedAnnotation.computeTypeAttributesForJavaType() - } - } ?: defaultTypeQualifier?.nullabilityQualifier + val nullabilityInfo = typeQualifierResolver.extractNullability(composedAnnotations) + ?: defaultTypeQualifier?.nullabilityQualifier - @Suppress("SimplifyBooleanWithConstants") return JavaTypeQualifiers( nullabilityInfo?.qualifier, - typeQualifierResolver.extractMutability(composedAnnotation), - isNotNullTypeParameter = nullabilityInfo?.qualifier == NullabilityQualifier.NOT_NULL && this.isTypeParameterBasedType(), + typeQualifierResolver.extractMutability(composedAnnotations), + isNotNullTypeParameter = nullabilityInfo?.qualifier == NullabilityQualifier.NOT_NULL && + type?.lowerBoundIfFlexible() is ConeTypeParameterType, isNullabilityQualifierForWarning = nullabilityInfo?.isForWarningOnly == true ) } - private fun FirTypeRef?.isTypeParameterBasedType() = - ((this as? FirJavaTypeRef)?.type as? JavaClassifierType)?.classifier is JavaTypeParameter - - private fun computeIndexedQualifiersForOverride(session: FirSession): IndexedJavaTypeQualifiers { - val indexedFromSupertypes = fromOverridden.map { it.toIndexed(typeQualifierResolver, context) } - val indexedThisType = current.toIndexed(typeQualifierResolver, context) + private fun computeIndexedQualifiersForOverride(current: ConeKotlinType?): IndexedJavaTypeQualifiers { + val indexedFromSupertypes = fromOverridden.map { it.toConeKotlinType(context.session).toIndexed(context) } + val indexedThisType = current.toIndexed(context) // The covariant case may be hard, e.g. in the superclass the return may be Super, but in the subclass it may be Derived, which // is declared to extend Super, and propagating data here is highly non-trivial, so we only look at the head type constructor @@ -218,9 +165,8 @@ internal class EnhancementSignatureParts( val treeSize = if (onlyHeadTypeConstructor) 1 else indexedThisType.size val computedResult = Array(treeSize) { index -> - val (type, defaultQualifiers) = indexedThisType[index] - val qualifiers = type.extractQualifiersFromAnnotations(index == 0, defaultQualifiers) - val superQualifiers = indexedFromSupertypes.mapNotNull { it.getOrNull(index)?.type?.extractQualifiers(session) } + val qualifiers = indexedThisType[index].extractQualifiersFromAnnotations(index == 0) + val superQualifiers = indexedFromSupertypes.mapNotNull { it.getOrNull(index)?.type?.extractQualifiers() } qualifiers.computeQualifiersForOverride(superQualifiers, index == 0 && isCovariant, index == 0 && isForVarargParameter) } @@ -233,4 +179,9 @@ internal class EnhancementSignatureParts( val wereChanges: Boolean, val containsFunctionN: Boolean ) + + private data class TypeAndDefaultQualifiers( + val type: ConeKotlinType?, // null denotes '*' here + val defaultQualifiers: JavaDefaultQualifiers? + ) } diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/javaTypeUtils.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/javaTypeUtils.kt index cf380ef1aa2..9f570e34c90 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/javaTypeUtils.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/enhancement/javaTypeUtils.kt @@ -13,7 +13,6 @@ import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.declarations.utils.collectEnumEntries import org.jetbrains.kotlin.fir.declarations.utils.isStatic import org.jetbrains.kotlin.fir.declarations.utils.modality -import org.jetbrains.kotlin.fir.expressions.FirAnnotationCall import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.expressions.builder.buildConstExpression import org.jetbrains.kotlin.fir.expressions.builder.buildPropertyAccessExpression @@ -29,7 +28,6 @@ import org.jetbrains.kotlin.fir.typeContext import org.jetbrains.kotlin.fir.types.* import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.types.jvm.FirJavaTypeRef -import org.jetbrains.kotlin.load.java.* import org.jetbrains.kotlin.load.java.structure.JavaClassifierType import org.jetbrains.kotlin.load.java.structure.JavaType import org.jetbrains.kotlin.load.java.typeEnhancement.* @@ -224,12 +222,6 @@ private fun ConeClassifierLookupTag.enhanceMutability( return this } - -internal data class TypeAndDefaultQualifiers( - val type: FirTypeRef?, // null denotes '*' here - val defaultQualifiers: JavaDefaultQualifiers? -) - internal fun JavaType.typeArguments(): List = (this as? JavaClassifierType)?.typeArguments.orEmpty() internal fun ConeKotlinType.lexicalCastFrom(session: FirSession, value: String): FirExpression? { @@ -282,22 +274,3 @@ internal fun ConeKotlinType.lexicalCastFrom(session: FirSession, value: String): else -> null } } - -internal fun List.computeTypeAttributesForJavaType(): ConeAttributes = - computeTypeAttributes { classId -> - when (classId) { - CompilerConeAttributes.EnhancedNullability.ANNOTATION_CLASS_ID -> add(CompilerConeAttributes.EnhancedNullability) - in NOT_NULL_ANNOTATION_IDS -> add(CompilerConeAttributes.EnhancedNullability) - JAVAX_NONNULL_ANNOTATION_ID, - JAVAX_CHECKFORNULL_ANNOTATION_ID, - COMPATQUAL_NONNULL_ANNOTATION_ID, - ANDROIDX_RECENTLY_NON_NULL_ANNOTATION_ID - -> add(CompilerConeAttributes.EnhancedNullability) - } - } - -private val NOT_NULL_ANNOTATION_IDS = NOT_NULL_ANNOTATIONS.map { ClassId.topLevel(it) } -private val JAVAX_NONNULL_ANNOTATION_ID = ClassId.topLevel(JAVAX_NONNULL_ANNOTATION) -private val JAVAX_CHECKFORNULL_ANNOTATION_ID = ClassId.topLevel(JAVAX_CHECKFORNULL_ANNOTATION) -private val COMPATQUAL_NONNULL_ANNOTATION_ID = ClassId.topLevel(COMPATQUAL_NONNULL_ANNOTATION) -private val ANDROIDX_RECENTLY_NON_NULL_ANNOTATION_ID = ClassId.topLevel(ANDROIDX_RECENTLY_NON_NULL_ANNOTATION) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt index 07e1aeea7fb..f9a2370fdba 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/AnnotatedBoundsOfWildcard.fir.kt @@ -44,8 +44,10 @@ fun main( b: AnnotatedBoundsOfWildcard ): Unit { - b.superAsIs(aAnyNotNullNotNullNotNull) - b.superAsIs(aAnyNotNullNotNullNull) + // jspecify_nullness_mismatch + b.superAsIs(aAnyNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.superAsIs(aAnyNotNullNotNullNull) b.superAsIs(aAnyNotNullNullNotNull) b.superAsIs(aAnyNotNullNullNull) @@ -54,18 +56,19 @@ fun main( b.superNotNull(aAnyNotNullNullNotNull) b.superNotNull(aAnyNotNullNullNull) - b.superNullable(aAnyNotNullNotNullNotNull) - b.superNullable(aAnyNotNullNotNullNull) - b.superNullable(aAnyNotNullNullNotNull) - b.superNullable(aAnyNotNullNullNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNotNullNotNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNotNullNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNullNotNull) + // jspecify_nullness_mismatch + b.superNullable(aAnyNotNullNullNull) b.extendsAsIs(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.extendsAsIs(aNotNullNotNullNull) - // jspecify_nullness_mismatch - b.extendsAsIs(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.extendsAsIs(aNotNullNullNull) + b.extendsAsIs(aNotNullNotNullNull) + b.extendsAsIs(aNotNullNullNotNull) + b.extendsAsIs(aNotNullNullNull) b.extendsNotNull(aNotNullNotNullNotNull) // jspecify_nullness_mismatch @@ -76,18 +79,12 @@ fun main( b.extendsNotNull(aNotNullNullNull) b.extendsNullable(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.extendsNullable(aNotNullNotNullNull) - // jspecify_nullness_mismatch - b.extendsNullable(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.extendsNullable(aNotNullNullNull) + b.extendsNullable(aNotNullNotNullNull) + b.extendsNullable(aNotNullNullNotNull) + b.extendsNullable(aNotNullNullNull) b.noBounds(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.noBounds(aNotNullNotNullNull) - // jspecify_nullness_mismatch - b.noBounds(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.noBounds(aNotNullNullNull) + b.noBounds(aNotNullNotNullNull) + b.noBounds(aNotNullNullNotNull) + b.noBounds(aNotNullNullNull) } diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt deleted file mode 100644 index 47c43e55f27..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.fir.kt +++ /dev/null @@ -1,38 +0,0 @@ -// JSPECIFY_STATE: strict -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: WildcardsWithDefault.java -import org.jspecify.nullness.*; - -@NullMarked -public class WildcardsWithDefault { - public void noBoundsNotNull(A a) {} - public void noBoundsNullable(A a) {} -} - -// FILE: A.java -import org.jspecify.nullness.*; - -public class A {} - -// FILE: main.kt -fun main( - aNotNullNotNullNotNull: A, - aNotNullNotNullNull: A, - aNotNullNullNotNull: A, - aNotNullNullNull: A, - b: WildcardsWithDefault -): Unit { - b.noBoundsNotNull(aNotNullNotNullNotNull) - b.noBoundsNotNull(aNotNullNotNullNull) - b.noBoundsNotNull(aNotNullNullNotNull) - b.noBoundsNotNull(aNotNullNullNull) - - b.noBoundsNullable(aNotNullNotNullNotNull) - // jspecify_nullness_mismatch - b.noBoundsNullable(aNotNullNotNullNull) - // jspecify_nullness_mismatch - b.noBoundsNullable(aNotNullNullNotNull) - // jspecify_nullness_mismatch - b.noBoundsNullable(aNotNullNullNull) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt index 8dd33227973..b49a858209c 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/strictMode/WildcardsWithDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JSPECIFY_STATE: strict // MUTE_FOR_PSI_CLASS_FILES_READING diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt index 86cd9390c03..ca25a05d5c3 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/AnnotatedBoundsOfWildcard.fir.kt @@ -43,8 +43,8 @@ fun main( b: AnnotatedBoundsOfWildcard ): Unit { - b.superAsIs(aAnyNotNullNotNullNotNull) - b.superAsIs(aAnyNotNullNotNullNull) + b.superAsIs(aAnyNotNullNotNullNotNull) + b.superAsIs(aAnyNotNullNotNullNull) b.superAsIs(aAnyNotNullNullNotNull) b.superAsIs(aAnyNotNullNullNull) @@ -53,15 +53,15 @@ fun main( b.superNotNull(aAnyNotNullNullNotNull) b.superNotNull(aAnyNotNullNullNull) - b.superNullable(aAnyNotNullNotNullNotNull) - b.superNullable(aAnyNotNullNotNullNull) - b.superNullable(aAnyNotNullNullNotNull) - b.superNullable(aAnyNotNullNullNull) + b.superNullable(aAnyNotNullNotNullNotNull) + b.superNullable(aAnyNotNullNotNullNull) + b.superNullable(aAnyNotNullNullNotNull) + b.superNullable(aAnyNotNullNullNull) b.extendsAsIs(aNotNullNotNullNotNull) - b.extendsAsIs(aNotNullNotNullNull) - b.extendsAsIs(aNotNullNullNotNull) - b.extendsAsIs(aNotNullNullNull) + b.extendsAsIs(aNotNullNotNullNull) + b.extendsAsIs(aNotNullNullNotNull) + b.extendsAsIs(aNotNullNullNull) b.extendsNotNull(aNotNullNotNullNotNull) b.extendsNotNull(aNotNullNotNullNull) @@ -69,12 +69,12 @@ fun main( b.extendsNotNull(aNotNullNullNull) b.extendsNullable(aNotNullNotNullNotNull) - b.extendsNullable(aNotNullNotNullNull) - b.extendsNullable(aNotNullNullNotNull) - b.extendsNullable(aNotNullNullNull) + b.extendsNullable(aNotNullNotNullNull) + b.extendsNullable(aNotNullNullNotNull) + b.extendsNullable(aNotNullNullNull) b.noBounds(aNotNullNotNullNotNull) - b.noBounds(aNotNullNotNullNull) - b.noBounds(aNotNullNullNotNull) - b.noBounds(aNotNullNullNull) + b.noBounds(aNotNullNotNullNull) + b.noBounds(aNotNullNullNotNull) + b.noBounds(aNotNullNullNull) } diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt deleted file mode 100644 index 95331be917c..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.fir.kt +++ /dev/null @@ -1,35 +0,0 @@ -// JSPECIFY_STATE: warn -// MUTE_FOR_PSI_CLASS_FILES_READING - -// FILE: WildcardsWithDefault.java -import org.jspecify.nullness.*; - -@NullMarked -public class WildcardsWithDefault { - public void noBoundsNotNull(A a) {} - public void noBoundsNullable(A a) {} -} - -// FILE: A.java -import org.jspecify.nullness.*; - -public class A {} - -// FILE: main.kt -fun main( - aNotNullNotNullNotNull: A, - aNotNullNotNullNull: A, - aNotNullNullNotNull: A, - aNotNullNullNull: A, - b: WildcardsWithDefault -): Unit { - b.noBoundsNotNull(aNotNullNotNullNotNull) - b.noBoundsNotNull(aNotNullNotNullNull) - b.noBoundsNotNull(aNotNullNullNotNull) - b.noBoundsNotNull(aNotNullNullNull) - - b.noBoundsNullable(aNotNullNotNullNotNull) - b.noBoundsNullable(aNotNullNotNullNull) - b.noBoundsNullable(aNotNullNullNotNull) - b.noBoundsNullable(aNotNullNullNull) -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt index 0af8c19f3c8..689eccab52b 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/jspecify/warnMode/WildcardsWithDefault.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // JSPECIFY_STATE: warn // MUTE_FOR_PSI_CLASS_FILES_READING diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt index 00a1fe08270..4214a39379d 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/notNullVarargsOverrides.fir.kt @@ -9,8 +9,8 @@ public class BaseClass { // FILE: main.kt class A : BaseClass() { // org.checkerframework.checker.nullness.qual.NonNull has @Target TYPE_USE, so it affects only elements type - override fun loadCache(vararg args: Any?) { - super.loadCache(*args) + override fun loadCache(vararg args: Any?) { + super.loadCache(*args) } } diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt deleted file mode 100644 index 9c610957203..00000000000 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.fir.kt +++ /dev/null @@ -1,21 +0,0 @@ -// SOURCE_RETENTION_ANNOTATIONS -// FILE: BaseClass.java -import org.checkerframework.checker.nullness.qual.*; - -public class BaseClass { - public void loadCache(@Nullable Object... args) {} -} - -// FILE: main.kt -class A : BaseClass() { - override fun loadCache(vararg args: Any?) { - super.loadCache(*args) - } -} - -class B : BaseClass() { - // org.checkerframework.checker.nullness.qual.Nullable has @Target TYPE_USE, so it affects only elements type - override fun loadCache(vararg args: Any) { - super.loadCache(*args) - } -} diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.kt index 1edf4df72cd..69f0a340a3d 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/nullableVarargsOverrides.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SOURCE_RETENTION_ANNOTATIONS // FILE: BaseClass.java import org.checkerframework.checker.nullness.qual.*; diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt index 8986251c580..43c4204c667 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnType.fir.kt @@ -51,13 +51,13 @@ fun main(a: ReturnType) { takeNotNullStringAndNotNullK(x3) takeNullableStringAndNotNullK(x3) - val x4 = ..kotlin.Array")!>a.foo4 + val x4 = ..kotlin.Array")!>a.foo4 takeArrayOfNotNullString(x4) takeArrayOfNullableString(x4) - takeArrayOfNotNullK(x4) - takeArrayOfNullableK(x4) + takeArrayOfNotNullK(x4) + takeArrayOfNullableK(x4) - val x5 = ?..kotlin.Array??")!>a.foo5() + val x5 = ?..kotlin.Array??")!>a.foo5() takeArrayOfNotNullString(x5) takeArrayOfNullableString(x5) takeArrayOfNotNullK(x5) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt index 44dc2a88ff1..ce728f13539 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/returnTypeWithWarnings.fir.kt @@ -53,13 +53,13 @@ fun main(a: ReturnTypeWithWarnings) { takeNotNullStringAndNotNullK(x3) takeNullableStringAndNotNullK(x3) - val x4 = ..kotlin.Array")!>a.foo4 + val x4 = ..kotlin.Array")!>a.foo4 takeArrayOfNotNullString(x4) takeArrayOfNullableString(x4) - takeArrayOfNotNullK(x4) - takeArrayOfNullableK(x4) + takeArrayOfNotNullK(x4) + takeArrayOfNullableK(x4) - val x5 = ?..kotlin.Array??")!>a.foo5() + val x5 = ?..kotlin.Array??")!>a.foo5() takeArrayOfNotNullString(x5) takeArrayOfNullableString(x5) takeArrayOfNotNullK(x5) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt index 8ac2f1f072a..beb36358a5c 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameter.fir.kt @@ -50,7 +50,7 @@ fun main(a: ValueParameter) { a.foo4(getArrayOfNotNullString()) a.foo4(getArrayOfNullableString()) a.foo4(getArrayOfNotNullK()) - a.foo4(getArrayOfNullableK()) + a.foo4(getArrayOfNullableK()) a.foo5(getArrayOfNotNullString()) a.foo5(getArrayOfNullableString()) diff --git a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt index acd64342226..725f84dba1f 100644 --- a/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt +++ b/compiler/testData/diagnostics/foreignAnnotationsTests/java8Tests/misc/valueParameterWithWarnings.fir.kt @@ -52,7 +52,7 @@ fun main(a: ValueParameterWithWarnings) { a.foo4(getArrayOfNotNullString()) a.foo4(getArrayOfNullableString()) a.foo4(getArrayOfNotNullK()) - a.foo4(getArrayOfNullableK()) + a.foo4(getArrayOfNullableK()) a.foo5(getArrayOfNotNullString()) a.foo5(getArrayOfNullableString()) diff --git a/compiler/testData/ir/irText/classes/kt43217.fir.txt b/compiler/testData/ir/irText/classes/kt43217.fir.txt index d1f089f49d7..0d40e5a1d2b 100644 --- a/compiler/testData/ir/irText/classes/kt43217.fir.txt +++ b/compiler/testData/ir/irText/classes/kt43217.fir.txt @@ -22,12 +22,12 @@ FILE fqName: fileName:/kt43217.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (): kotlin.Double [operator] declared in .A.b.' CONST Double type=kotlin.Double value=0.0 - FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] @[Override] kotlin.Any [fake_override] + FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] annotations: NotNull(value = ) Override overridden: - public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] @[Override] kotlin.Any declared in .DoubleExpression + public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] kotlin.Any declared in .DoubleExpression $this: VALUE_PARAMETER name: type:.DoubleExpression VALUE_PARAMETER name:value index:0 type:kotlin.Double FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.ObservableValue.ObservableValue>, value:@[EnhancedNullability] kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] @@ -84,12 +84,12 @@ FILE fqName: fileName:/kt43217.kt BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun get (): kotlin.Double [operator] declared in .C' CONST Double type=kotlin.Double value=0.0 - FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] @[Override] kotlin.Any [fake_override] + FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.DoubleExpression, value:kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] annotations: NotNull(value = ) Override overridden: - public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] @[Override] kotlin.Any declared in .DoubleExpression + public open fun isEqualTo (value: kotlin.Double): @[EnhancedNullability] kotlin.Any declared in .DoubleExpression $this: VALUE_PARAMETER name: type:.DoubleExpression VALUE_PARAMETER name:value index:0 type:kotlin.Double FUN FAKE_OVERRIDE name:isEqualTo visibility:public modality:OPEN <> ($this:.ObservableValue.ObservableValue>, value:@[EnhancedNullability] kotlin.Double) returnType:@[EnhancedNullability] kotlin.Any [fake_override] diff --git a/compiler/testData/loadJava/compiledJava/annotations/AnnotatedTypeInFun.fir.txt b/compiler/testData/loadJava/compiledJava/annotations/AnnotatedTypeInFun.fir.txt index 8c7184c1d0d..99c5a5cad38 100644 --- a/compiler/testData/loadJava/compiledJava/annotations/AnnotatedTypeInFun.fir.txt +++ b/compiler/testData/loadJava/compiledJava/annotations/AnnotatedTypeInFun.fir.txt @@ -1,5 +1,5 @@ public/*package*/ open class AnnotatedTypeInFun : R|kotlin/Any| { - public/*package*/ open fun foo(@R|test/AnnotatedTypeInFun.Anno|(String(a)) a: R|ft|, @R|test/AnnotatedTypeInFun.Anno|(String(b)) b: R|ft|): R|kotlin/Unit| + public/*package*/ open fun foo(@R|test/AnnotatedTypeInFun.Anno|(String(a)) a: R|ft<@R|test/AnnotatedTypeInFun.Anno|(String(a)) kotlin/String, @R|test/AnnotatedTypeInFun.Anno|(String(a)) kotlin/String?>|, @R|test/AnnotatedTypeInFun.Anno|(String(b)) b: R|ft<@R|test/AnnotatedTypeInFun.Anno|(String(b)) kotlin/String, @R|test/AnnotatedTypeInFun.Anno|(String(b)) kotlin/String?>|): R|kotlin/Unit| public/*package*/ constructor(): R|test/AnnotatedTypeInFun| diff --git a/compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.fir.txt b/compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.fir.txt index 8aa4301a07e..a5cf9efd5d1 100644 --- a/compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.fir.txt +++ b/compiler/testData/loadJava/compiledJava/modality/ModalityOfFakeOverrides.fir.txt @@ -1,5 +1,5 @@ public open class ModalityOfFakeOverrides : R|java/util/AbstractList>| { - @R|java/lang/Override|() @R|org/jetbrains/annotations/NotNull|() public open operator fun get(index: R|kotlin/Int|): R|@EnhancedNullability @R|java/lang/Override|() kotlin/String| + @R|java/lang/Override|() @R|org/jetbrains/annotations/NotNull|() public open operator fun get(index: R|kotlin/Int|): R|@EnhancedNullability kotlin/String| public constructor(): R|test/ModalityOfFakeOverrides| diff --git a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.fir.txt b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.fir.txt index 393a64a0c79..60474481549 100644 --- a/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.fir.txt +++ b/compiler/testData/loadJava/compiledJava/mutability/LoadIterableWithNullability.fir.txt @@ -1,10 +1,10 @@ public abstract interface LoadIterableWithNullability|> : R|kotlin/Any| { - @R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/Mutable|() public abstract fun getIterable(): R|@EnhancedNullability @R|kotlin/annotations/jvm/Mutable|() kotlin/collections/MutableIterable>| + @R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/Mutable|() public abstract fun getIterable(): R|@EnhancedNullability kotlin/collections/MutableIterable>| - public abstract fun setIterable(@R|kotlin/annotations/jvm/Mutable|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|@EnhancedNullability @R|kotlin/annotations/jvm/Mutable|() kotlin/collections/MutableIterable>|): R|kotlin/Unit| + public abstract fun setIterable(@R|kotlin/annotations/jvm/Mutable|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|@EnhancedNullability kotlin/collections/MutableIterable>|): R|kotlin/Unit| - @R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/ReadOnly|() public abstract fun getReadOnlyIterable(): R|@EnhancedNullability @R|kotlin/annotations/jvm/ReadOnly|() kotlin/collections/Iterable>| + @R|org/jetbrains/annotations/NotNull|() @R|kotlin/annotations/jvm/ReadOnly|() public abstract fun getReadOnlyIterable(): R|@EnhancedNullability kotlin/collections/Iterable>| - public abstract fun setReadOnlyIterable(@R|kotlin/annotations/jvm/ReadOnly|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|@EnhancedNullability @R|kotlin/annotations/jvm/ReadOnly|() kotlin/collections/Iterable>|): R|kotlin/Unit| + public abstract fun setReadOnlyIterable(@R|kotlin/annotations/jvm/ReadOnly|() @R|org/jetbrains/annotations/NotNull|() Iterable: R|@EnhancedNullability kotlin/collections/Iterable>|): R|kotlin/Unit| }