diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt index 36bcd910d68..e4d507d9432 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/java/deserialization/KotlinDeserializedJvmSymbolsProvider.kt @@ -10,6 +10,7 @@ import org.jetbrains.kotlin.fir.FirSession import org.jetbrains.kotlin.fir.declarations.FirDeclaration import org.jetbrains.kotlin.fir.declarations.FirNamedDeclaration import org.jetbrains.kotlin.fir.declarations.FirRegularClass +import org.jetbrains.kotlin.fir.declarations.impl.FirEnumEntryImpl import org.jetbrains.kotlin.fir.deserialization.FirDeserializationContext import org.jetbrains.kotlin.fir.deserialization.deserializeClassToSymbol import org.jetbrains.kotlin.fir.java.topLevelName @@ -26,10 +27,12 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirTypeAliasSymbol import org.jetbrains.kotlin.load.java.JavaClassFinder import org.jetbrains.kotlin.load.java.structure.JavaClass import org.jetbrains.kotlin.load.kotlin.KotlinClassFinder +import org.jetbrains.kotlin.load.kotlin.KotlinJvmBinaryClass import org.jetbrains.kotlin.load.kotlin.PackagePartProvider import org.jetbrains.kotlin.load.kotlin.findKotlinClass import org.jetbrains.kotlin.load.kotlin.header.KotlinClassHeader import org.jetbrains.kotlin.metadata.ProtoBuf +import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmNameResolver import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.FqName @@ -120,6 +123,11 @@ class KotlinDeserializedJvmSymbolsProvider( } } + private fun KotlinJvmBinaryClass.readClassDataFrom(): Pair? { + val data = classHeader.data ?: return null + val strings = classHeader.strings ?: return null + return JvmProtoBufUtil.readClassDataFrom(data, strings) + } private fun findAndDeserializeClass( classId: ClassId, @@ -128,19 +136,30 @@ class KotlinDeserializedJvmSymbolsProvider( if (!hasTopLevelClassOf(classId)) return null return classesCache.getOrPut(classId) { //return null - val kotlinJvmBinaryClass = kotlinClassFinder.findKotlinClass(classId) ?: return null - if (kotlinJvmBinaryClass.classHeader.kind != KotlinClassHeader.Kind.CLASS) return null + val kotlinJvmBinaryClass = kotlinClassFinder.findKotlinClass(classId) + if (kotlinJvmBinaryClass == null) { + val outerClassId = classId.outerClassId ?: return null + val outerJvmBinaryClass = kotlinClassFinder.findKotlinClass(outerClassId) ?: return null + if (outerJvmBinaryClass.classHeader.kind != KotlinClassHeader.Kind.CLASS) return null + val (nameResolver, outerClassProto) = outerJvmBinaryClass.readClassDataFrom() ?: return null + if (outerClassProto.enumEntryList.none { nameResolver.getName(it.name) == classId.shortClassName }) { + return null + } - val data = kotlinJvmBinaryClass.classHeader.data ?: return null - val strings = kotlinJvmBinaryClass.classHeader.strings ?: return null - val (nameResolver, classProto) = JvmProtoBufUtil.readClassDataFrom(data, strings) + val symbol = FirClassSymbol(classId) + FirEnumEntryImpl(session, null, symbol, classId.shortClassName) + symbol + } else { + if (kotlinJvmBinaryClass.classHeader.kind != KotlinClassHeader.Kind.CLASS) return null + val (nameResolver, classProto) = kotlinJvmBinaryClass.readClassDataFrom() ?: return null - val symbol = FirClassSymbol(classId) - deserializeClassToSymbol( - classId, classProto, symbol, nameResolver, session, parentContext, - this::findAndDeserializeClass - ) - symbol + val symbol = FirClassSymbol(classId) + deserializeClassToSymbol( + classId, classProto, symbol, nameResolver, session, parentContext, + this::findAndDeserializeClass + ) + symbol + } } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt index d8bbccdb904..eb047af24b0 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/ClassDeserialization.kt @@ -18,6 +18,7 @@ import org.jetbrains.kotlin.metadata.deserialization.supertypes import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.serialization.deserialization.ProtoEnumFlags +import org.jetbrains.kotlin.serialization.deserialization.getName fun deserializeClassToSymbol( classId: ClassId, @@ -76,6 +77,15 @@ fun deserializeClassToSymbol( deserializeNestedClass(nestedClassId, context)?.fir } ) + + addDeclarations( + classProto.enumEntryList.mapNotNull { enumEntryProto -> + val enumEntryName = nameResolver.getName(enumEntryProto.name) + val enumEntryId = classId.createNestedClassId(enumEntryName) + val deserializedClassSymbol = deserializeNestedClass(enumEntryId, context) + deserializedClassSymbol?.fir + } + ) } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirAnnotationDeserializer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirAnnotationDeserializer.kt index fe49a504ed7..1e3bc20176c 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirAnnotationDeserializer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/deserialization/FirAnnotationDeserializer.kt @@ -13,11 +13,8 @@ import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.expressions.impl.* import org.jetbrains.kotlin.fir.references.FirErrorNamedReference import org.jetbrains.kotlin.fir.references.FirResolvedCallableReferenceImpl -import org.jetbrains.kotlin.fir.resolve.FirSymbolProvider import org.jetbrains.kotlin.fir.resolve.constructType -import org.jetbrains.kotlin.fir.resolve.getClassDeclaredCallableSymbols import org.jetbrains.kotlin.fir.resolve.toSymbol -import org.jetbrains.kotlin.fir.service import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTagImpl import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol import org.jetbrains.kotlin.fir.types.FirTypeRef @@ -142,11 +139,10 @@ class FirAnnotationDeserializer( ENUM -> FirFunctionCallImpl(session, null).apply { val classId = nameResolver.getClassId(value.classId) val entryName = nameResolver.getName(value.enumValueId) - val callableSymbol = - this@FirAnnotationDeserializer.session.service().getClassDeclaredCallableSymbols( - classId, entryName - ).firstOrNull() - this.calleeReference = callableSymbol?.let { + val entryClassId = classId.createNestedClassId(entryName) + val entryLookupTag = ConeClassLikeLookupTagImpl(entryClassId) + val entrySymbol = entryLookupTag.toSymbol(this@FirAnnotationDeserializer.session) + this.calleeReference = entrySymbol?.let { FirResolvedCallableReferenceImpl(this@FirAnnotationDeserializer.session, null, entryName, it) } ?: FirErrorNamedReference( this@FirAnnotationDeserializer.session, null, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirLibrarySymbolProviderImpl.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirLibrarySymbolProviderImpl.kt index 5a930bd32a8..30993b05853 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirLibrarySymbolProviderImpl.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/impl/FirLibrarySymbolProviderImpl.kt @@ -16,6 +16,7 @@ import org.jetbrains.kotlin.fir.declarations.FirCallableMemberDeclaration import org.jetbrains.kotlin.fir.declarations.FirDeclaration import org.jetbrains.kotlin.fir.declarations.FirRegularClass import org.jetbrains.kotlin.fir.declarations.impl.FirClassImpl +import org.jetbrains.kotlin.fir.declarations.impl.FirEnumEntryImpl import org.jetbrains.kotlin.fir.deserialization.FirDeserializationContext import org.jetbrains.kotlin.fir.deserialization.deserializeClassToSymbol import org.jetbrains.kotlin.fir.resolve.* @@ -76,16 +77,29 @@ class FirLibrarySymbolProviderImpl(val session: FirSession) : FirSymbolProvider classId: ClassId, parentContext: FirDeserializationContext? = null ): FirClassSymbol? { - if (classId !in classDataFinder.allClassIds) return null + val classIdExists = classId in classDataFinder.allClassIds + val shouldBeEnumEntry = !classIdExists && classId.outerClassId in classDataFinder.allClassIds + if (!classIdExists && !shouldBeEnumEntry) return null + if (shouldBeEnumEntry) { + val outerClassData = classDataFinder.findClassData(classId.outerClassId!!)!! + val outerClassProto = outerClassData.classProto + if (outerClassProto.enumEntryList.none { nameResolver.getName(it.name) == classId.shortClassName }) { + return null + } + } return lookup.getOrPut(classId, { FirClassSymbol(classId) }) { symbol -> - val classData = classDataFinder.findClassData(classId)!! - val classProto = classData.classProto + if (shouldBeEnumEntry) { + FirEnumEntryImpl(session, null, symbol, classId.shortClassName) + } else { + val classData = classDataFinder.findClassData(classId)!! + val classProto = classData.classProto - deserializeClassToSymbol( - classId, classProto, symbol, nameResolver, session, - parentContext, - this::findAndDeserializeClass - ) + deserializeClassToSymbol( + classId, classProto, symbol, nameResolver, session, + parentContext, + this::findAndDeserializeClass + ) + } } } diff --git a/compiler/fir/resolve/testData/builtIns/kotlin.txt b/compiler/fir/resolve/testData/builtIns/kotlin.txt index 1ee5c8a764b..f9b3d359751 100644 --- a/compiler/fir/resolve/testData/builtIns/kotlin.txt +++ b/compiler/fir/resolve/testData/builtIns/kotlin.txt @@ -133,17 +133,17 @@ public final class Byte : R|kotlin/Number|, R|kotlin/Comparable| { public final operator fun minus(other: R|kotlin/Short|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Long| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Long| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Int| public final operator fun plus(other: R|kotlin/Byte|): R|kotlin/Int| @@ -365,6 +365,15 @@ public abstract interface Comparable : R|kotlin/Any| { public final enum class DeprecationLevel : R|kotlin/Enum| { private constructor(): R|kotlin/DeprecationLevel| + public? final enum entry WARNING { + } + + public? final enum entry ERROR { + } + + public? final enum entry HIDDEN { + } + } public final class Double : R|kotlin/Number|, R|kotlin/Comparable| { @@ -408,17 +417,17 @@ public final class Double : R|kotlin/Number|, R|kotlin/Comparable public final operator fun minus(other: R|kotlin/Short|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Double| public final operator fun plus(other: R|kotlin/Byte|): R|kotlin/Double| @@ -514,7 +523,7 @@ public final class DoubleArray : R|kotlin/Any| { } -@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = #()) @R|kotlin/annotation/MustBeDocumented|() @R|kotlin/SinceKotlin|(version = String(1.1)) public final annotation class DslMarker : R|kotlin/Annotation| { +@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.BINARY|()) @R|kotlin/annotation/MustBeDocumented|() @R|kotlin/SinceKotlin|(version = String(1.1)) public final annotation class DslMarker : R|kotlin/Annotation| { public constructor(): R|kotlin/DslMarker| } @@ -591,17 +600,17 @@ public final class Float : R|kotlin/Number|, R|kotlin/Comparable| public final operator fun minus(other: R|kotlin/Short|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Float| public final operator fun plus(other: R|kotlin/Byte|): R|kotlin/Float| @@ -745,17 +754,17 @@ public final class Int : R|kotlin/Number|, R|kotlin/Comparable| { public final operator fun minus(other: R|kotlin/Short|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Long| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Long| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Int| public final infix fun or(other: R|kotlin/Int|): R|kotlin/Int| @@ -911,17 +920,17 @@ public final class Long : R|kotlin/Number|, R|kotlin/Comparable| { public final operator fun minus(other: R|kotlin/Short|): R|kotlin/Long| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Long| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Long| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Long| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Long| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Long| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Long| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Long| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Long| public final infix fun or(other: R|kotlin/Long|): R|kotlin/Long| @@ -1064,12 +1073,12 @@ public abstract class Number : R|kotlin/Any| { } -@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = #()) @R|kotlin/annotation/MustBeDocumented|() @R|kotlin/SinceKotlin|(version = String(1.1)) public final annotation class PublishedApi : R|kotlin/Annotation| { +@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.BINARY|()) @R|kotlin/annotation/MustBeDocumented|() @R|kotlin/SinceKotlin|(version = String(1.1)) public final annotation class PublishedApi : R|kotlin/Annotation| { public constructor(): R|kotlin/PublishedApi| } -@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = #()) @R|kotlin/annotation/MustBeDocumented|() public final annotation class ReplaceWith : R|kotlin/Annotation| { +@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.BINARY|()) @R|kotlin/annotation/MustBeDocumented|() public final annotation class ReplaceWith : R|kotlin/Annotation| { public final val expression: R|kotlin/String| public get(): R|kotlin/String| @@ -1121,17 +1130,17 @@ public final class Short : R|kotlin/Number|, R|kotlin/Comparable| public final operator fun minus(other: R|kotlin/Short|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Byte|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Double|): R|kotlin/Double| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Float|): R|kotlin/Float| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Int|): R|kotlin/Int| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Long| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Long|): R|kotlin/Long| - @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = #()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Int| + @R|kotlin/Deprecated|(message = String(Use rem(other) instead), replaceWith = @R|kotlin/ReplaceWith|(expression = String(rem(other))) , level = R|kotlin/DeprecationLevel.ERROR|()) public final operator fun mod(other: R|kotlin/Short|): R|kotlin/Int| public final operator fun plus(other: R|kotlin/Byte|): R|kotlin/Int| @@ -1232,7 +1241,7 @@ public final class ShortArray : R|kotlin/Any| { } -@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = #()) @R|kotlin/annotation/MustBeDocumented|() public final annotation class SinceKotlin : R|kotlin/Annotation| { +@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.BINARY|()) @R|kotlin/annotation/MustBeDocumented|() public final annotation class SinceKotlin : R|kotlin/Annotation| { public final val version: R|kotlin/String| public get(): R|kotlin/String| @@ -1261,7 +1270,7 @@ public final class String : R|kotlin/Comparable|, R|kotlin/CharSe } -@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = #()) public final annotation class Suppress : R|kotlin/Annotation| { +@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.SOURCE|()) public final annotation class Suppress : R|kotlin/Annotation| { public final val names: R|kotlin/Array| public get(): R|kotlin/Array| @@ -1293,7 +1302,7 @@ public final object Unit : R|kotlin/Any| { } -@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = #()) @R|kotlin/annotation/MustBeDocumented|() public final annotation class UnsafeVariance : R|kotlin/Annotation| { +@R|kotlin/annotation/Target|() @R|kotlin/annotation/Retention|(value = R|kotlin/annotation/AnnotationRetention.SOURCE|()) @R|kotlin/annotation/MustBeDocumented|() public final annotation class UnsafeVariance : R|kotlin/Annotation| { public constructor(): R|kotlin/UnsafeVariance| } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/AnnotationInAnnotationArguments.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/AnnotationInAnnotationArguments.txt index 2a57e998568..5d63148f71d 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/AnnotationInAnnotationArguments.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/AnnotationInAnnotationArguments.txt @@ -6,6 +6,9 @@ public final class AnnotationInAnnotationArguments : R|kotlin/Any| { public final enum class E : R|kotlin/Enum| { private constructor(): R|test/E| + public? final enum entry ENTRY { + } + } public final annotation class EnumOption : R|kotlin/Annotation| { diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/EnumArgumentWithCustomToString.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/EnumArgumentWithCustomToString.txt index 9e173ad0b5c..137fa380e69 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/EnumArgumentWithCustomToString.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/EnumArgumentWithCustomToString.txt @@ -1,6 +1,11 @@ public final enum class E : R|kotlin/Enum| { private constructor(): R|test/E| + public final enum entry CAKE : R|test/E| { + public open fun toString(): R|kotlin/String| + + } + } public final annotation class EnumAnno : R|kotlin/Annotation| { diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/classMembers/EnumEntry.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/classMembers/EnumEntry.txt index 555392e675a..fcfc0954102 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/classMembers/EnumEntry.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/annotations/classMembers/EnumEntry.txt @@ -17,4 +17,17 @@ public final annotation class Bnno : R|kotlin/Annotation| { public final enum class Eee : R|kotlin/Enum| { private constructor(): R|test/Eee| + public? final enum entry Entry1 { + } + + public? final enum entry Entry2 { + } + + public? final enum entry Entry3 { + } + + public? final enum entry Entry4 { + } + } + diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumVisibility.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumVisibility.txt index fd2fa0a89bd..50866f94139 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumVisibility.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumVisibility.txt @@ -1,14 +1,24 @@ internal final enum class In : R|kotlin/Enum| { private constructor(): R|test/In| + public? final enum entry A { + } + } private final enum class Pr : R|kotlin/Enum| { private constructor(): R|test/Pr| + public? final enum entry A { + } + } public final enum class Pu : R|kotlin/Enum| { private constructor(): R|test/Pu| + public? final enum entry A { + } + } + diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithConstuctor.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithConstuctor.txt index c11a98d5678..f61db5c84fc 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithConstuctor.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithConstuctor.txt @@ -7,4 +7,14 @@ public final enum class En : R|kotlin/Enum| { private constructor(b: R|kotlin/Boolean| = STUB, i: R|kotlin/Int| = STUB): R|test/En| + public? final enum entry E1 { + } + + public? final enum entry E2 { + } + + public? final enum entry E3 { + } + } + diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt index bda0d871886..7895b2a4ab1 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/EnumWithInnerClasses.txt @@ -19,4 +19,11 @@ public final enum class Enum : R|kotlin/Enum| { public abstract interface Trait : R|kotlin/Any| { } + public? final enum entry ENTRY1 { + } + + public? final enum entry ENTRY2 { + } + } + diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnum.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnum.txt index 542ede7def3..c42098e1fd8 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnum.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnum.txt @@ -4,6 +4,9 @@ public final class A : R|kotlin/Any| { public final enum class E : R|kotlin/Enum| { private constructor(): R|test/A.E| + public? final enum entry ENTRY { + } + } } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnumExistingClassObject.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnumExistingClassObject.txt index 121cb2084e3..729ba3f7614 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnumExistingClassObject.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/InnerEnumExistingClassObject.txt @@ -9,6 +9,9 @@ public final class A : R|kotlin/Any| { public final enum class E : R|kotlin/Enum| { private constructor(): R|test/A.E| + public? final enum entry ENTRY { + } + } } diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/SimpleEnum.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/SimpleEnum.txt index da515ef0af0..4b3ab51b095 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/enum/SimpleEnum.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/enum/SimpleEnum.txt @@ -1,4 +1,8 @@ public final enum class MyEnum : R|kotlin/Enum| { private constructor(): R|test/MyEnum| + public? final enum entry ENTRY { + } + } + diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/fromLoadJava/Enum.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/fromLoadJava/Enum.txt index 4d7fabda64d..5d6c194ada4 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/fromLoadJava/Enum.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/fromLoadJava/Enum.txt @@ -1,4 +1,11 @@ public final enum class Test : R|kotlin/Enum| { private constructor(a: R|kotlin/Int|): R|test/Test| + public? final enum entry A { + } + + public? final enum entry B { + } + } + diff --git a/compiler/fir/resolve/testData/loadCompiledKotlin/memberOrder/EnumEntries.txt b/compiler/fir/resolve/testData/loadCompiledKotlin/memberOrder/EnumEntries.txt index 0aee519416c..58bb7392e78 100644 --- a/compiler/fir/resolve/testData/loadCompiledKotlin/memberOrder/EnumEntries.txt +++ b/compiler/fir/resolve/testData/loadCompiledKotlin/memberOrder/EnumEntries.txt @@ -1,4 +1,29 @@ public final enum class E : R|kotlin/Enum| { private constructor(): R|test/E| + public? final enum entry ONE { + } + + public? final enum entry TWO { + } + + public? final enum entry THREE { + } + + public? final enum entry FOUR { + } + + public? final enum entry FIVE { + } + + public? final enum entry SIX { + } + + public? final enum entry SEVEN { + } + + public? final enum entry EIGHT { + } + } +