[FIR] Set publishedApiEffectiveVisibility on deserialized declarations
#KT-58641 Fixed
This commit is contained in:
committed by
Space Team
parent
2581139b82
commit
ee91ee9403
+13
-3
@@ -20,6 +20,8 @@ import org.jetbrains.kotlin.fir.DependencyListForCliModule
|
|||||||
import org.jetbrains.kotlin.fir.FirSession
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
|
import org.jetbrains.kotlin.fir.declarations.FirMemberDeclaration
|
||||||
import org.jetbrains.kotlin.fir.declarations.utils.nameOrSpecialName
|
import org.jetbrains.kotlin.fir.declarations.utils.nameOrSpecialName
|
||||||
|
import org.jetbrains.kotlin.fir.renderer.FirDeclarationRenderer
|
||||||
|
import org.jetbrains.kotlin.fir.renderer.FirDeclarationRendererWithFilteredAttributes
|
||||||
import org.jetbrains.kotlin.fir.renderer.FirRenderer
|
import org.jetbrains.kotlin.fir.renderer.FirRenderer
|
||||||
import org.jetbrains.kotlin.fir.resolve.providers.firProvider
|
import org.jetbrains.kotlin.fir.resolve.providers.firProvider
|
||||||
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
||||||
@@ -175,8 +177,9 @@ abstract class AbstractLoadedMetadataDumpHandler<A : ResultingArtifact.Binary<A>
|
|||||||
).single().session
|
).single().session
|
||||||
|
|
||||||
val packageFqName = FqName("test")
|
val packageFqName = FqName("test")
|
||||||
|
val printAttributes = FirDiagnosticsDirectives.RENDER_FIR_DECLARATION_ATTRIBUTES in module.directives
|
||||||
dumper.builderForModule(module)
|
dumper.builderForModule(module)
|
||||||
.append(collectPackageContent(session, packageFqName, extractNames(module, packageFqName)))
|
.append(collectPackageContent(session, packageFqName, extractNames(module, packageFqName), printAttributes))
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract val targetPlatform: TargetPlatform
|
protected abstract val targetPlatform: TargetPlatform
|
||||||
@@ -296,11 +299,18 @@ abstract class AbstractLoadedMetadataDumpHandler<A : ResultingArtifact.Binary<A>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun collectPackageContent(session: FirSession, packageFqName: FqName, declarationNames: Collection<Name>): String {
|
private fun collectPackageContent(session: FirSession, packageFqName: FqName, declarationNames: Collection<Name>, printAttributes: Boolean): String {
|
||||||
val provider = session.symbolProvider
|
val provider = session.symbolProvider
|
||||||
|
|
||||||
val builder = StringBuilder()
|
val builder = StringBuilder()
|
||||||
val firRenderer = FirRenderer(builder)
|
val firRenderer = FirRenderer(
|
||||||
|
builder,
|
||||||
|
declarationRenderer = if (printAttributes) {
|
||||||
|
FirDeclarationRendererWithFilteredAttributes()
|
||||||
|
} else {
|
||||||
|
FirDeclarationRenderer()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
for (name in declarationNames) {
|
for (name in declarationNames) {
|
||||||
for (symbol in provider.getTopLevelCallableSymbols(packageFqName, name)) {
|
for (symbol in provider.getTopLevelCallableSymbols(packageFqName, name)) {
|
||||||
|
|||||||
+6
@@ -3202,6 +3202,12 @@ public class FirLoadK1CompiledJvmKotlinTestGenerated extends AbstractFirLoadK1Co
|
|||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("PublishedApi.kt")
|
||||||
|
public void testPublishedApi() throws Exception {
|
||||||
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PublishedApi.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
||||||
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
||||||
|
|||||||
+6
@@ -3202,6 +3202,12 @@ public class FirLoadK2CompiledJvmKotlinTestGenerated extends AbstractFirLoadK2Co
|
|||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("PublishedApi.kt")
|
||||||
|
public void testPublishedApi() throws Exception {
|
||||||
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PublishedApi.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
||||||
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
||||||
|
|||||||
+4
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.fir.declarations.utils.moduleName
|
|||||||
import org.jetbrains.kotlin.fir.declarations.utils.sourceElement
|
import org.jetbrains.kotlin.fir.declarations.utils.sourceElement
|
||||||
import org.jetbrains.kotlin.fir.resolve.providers.getRegularClassSymbolByClassId
|
import org.jetbrains.kotlin.fir.resolve.providers.getRegularClassSymbolByClassId
|
||||||
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
import org.jetbrains.kotlin.fir.resolve.providers.symbolProvider
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.transformers.setLazyPublishedVisibility
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirScopeProvider
|
import org.jetbrains.kotlin.fir.scopes.FirScopeProvider
|
||||||
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
import org.jetbrains.kotlin.fir.symbols.ConeTypeParameterLookupTag
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirEnumEntrySymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirEnumEntrySymbol
|
||||||
@@ -114,6 +115,7 @@ fun deserializeClassToSymbol(
|
|||||||
context.annotationDeserializer.inheritAnnotationInfo(it.annotationDeserializer)
|
context.annotationDeserializer.inheritAnnotationInfo(it.annotationDeserializer)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
buildRegularClass {
|
buildRegularClass {
|
||||||
this.moduleData = moduleData
|
this.moduleData = moduleData
|
||||||
this.origin = origin
|
this.origin = origin
|
||||||
@@ -242,6 +244,8 @@ fun deserializeClassToSymbol(
|
|||||||
if (!Flags.HAS_ENUM_ENTRIES.get(flags)) {
|
if (!Flags.HAS_ENUM_ENTRIES.get(flags)) {
|
||||||
hasNoEnumEntriesAttr = true
|
hasNoEnumEntriesAttr = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setLazyPublishedVisibility(session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
@@ -20,6 +20,7 @@ import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
|||||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||||
import org.jetbrains.kotlin.fir.expressions.builder.buildExpressionStub
|
import org.jetbrains.kotlin.fir.expressions.builder.buildExpressionStub
|
||||||
import org.jetbrains.kotlin.fir.resolve.defaultType
|
import org.jetbrains.kotlin.fir.resolve.defaultType
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.transformers.setLazyPublishedVisibility
|
||||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.*
|
import org.jetbrains.kotlin.fir.symbols.impl.*
|
||||||
import org.jetbrains.kotlin.fir.toEffectiveVisibility
|
import org.jetbrains.kotlin.fir.toEffectiveVisibility
|
||||||
@@ -467,6 +468,9 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
|||||||
proto.contextReceiverTypes(c.typeTable).mapTo(contextReceivers, ::loadContextReceiver)
|
proto.contextReceiverTypes(c.typeTable).mapTo(contextReceivers, ::loadContextReceiver)
|
||||||
}.apply {
|
}.apply {
|
||||||
versionRequirementsTable = c.versionRequirementTable
|
versionRequirementsTable = c.versionRequirementTable
|
||||||
|
setLazyPublishedVisibility(c.session)
|
||||||
|
getter?.setLazyPublishedVisibility(annotations, this, c.session)
|
||||||
|
setter?.setLazyPublishedVisibility(annotations, this, c.session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -552,6 +556,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
|||||||
proto.contextReceiverTypes(c.typeTable).mapTo(contextReceivers, ::loadContextReceiver)
|
proto.contextReceiverTypes(c.typeTable).mapTo(contextReceivers, ::loadContextReceiver)
|
||||||
}.apply {
|
}.apply {
|
||||||
versionRequirementsTable = c.versionRequirementTable
|
versionRequirementsTable = c.versionRequirementTable
|
||||||
|
setLazyPublishedVisibility(c.session)
|
||||||
}
|
}
|
||||||
if (proto.hasContract()) {
|
if (proto.hasContract()) {
|
||||||
val contractDeserializer = if (proto.typeParameterList.isEmpty()) this.contractDeserializer else FirContractDeserializer(local)
|
val contractDeserializer = if (proto.typeParameterList.isEmpty()) this.contractDeserializer else FirContractDeserializer(local)
|
||||||
@@ -635,6 +640,7 @@ class FirMemberDeserializer(private val c: FirDeserializationContext) {
|
|||||||
}.build().apply {
|
}.build().apply {
|
||||||
containingClassForStaticMemberAttr = c.dispatchReceiver!!.lookupTag
|
containingClassForStaticMemberAttr = c.dispatchReceiver!!.lookupTag
|
||||||
versionRequirementsTable = c.versionRequirementTable
|
versionRequirementsTable = c.versionRequirementTable
|
||||||
|
setLazyPublishedVisibility(c.session)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
@@ -37387,6 +37387,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("noMangling.kt")
|
@TestMetadata("noMangling.kt")
|
||||||
public void testNoMangling() throws Exception {
|
public void testNoMangling() throws Exception {
|
||||||
|
|||||||
+6
@@ -37387,6 +37387,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("noMangling.kt")
|
@TestMetadata("noMangling.kt")
|
||||||
public void testNoMangling() throws Exception {
|
public void testNoMangling() throws Exception {
|
||||||
|
|||||||
+11
-2
@@ -16,6 +16,7 @@ import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
|||||||
import org.jetbrains.kotlin.fir.java.FirJavaFacade
|
import org.jetbrains.kotlin.fir.java.FirJavaFacade
|
||||||
import org.jetbrains.kotlin.fir.java.declarations.FirJavaClass
|
import org.jetbrains.kotlin.fir.java.declarations.FirJavaClass
|
||||||
import org.jetbrains.kotlin.fir.languageVersionSettings
|
import org.jetbrains.kotlin.fir.languageVersionSettings
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.transformers.setLazyPublishedVisibility
|
||||||
import org.jetbrains.kotlin.fir.scopes.FirKotlinScopeProvider
|
import org.jetbrains.kotlin.fir.scopes.FirKotlinScopeProvider
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirRegularClassSymbol
|
||||||
import org.jetbrains.kotlin.load.kotlin.*
|
import org.jetbrains.kotlin.load.kotlin.*
|
||||||
@@ -27,6 +28,7 @@ import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmMetadataVersion
|
|||||||
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
|
import org.jetbrains.kotlin.metadata.jvm.deserialization.JvmProtoBufUtil
|
||||||
import org.jetbrains.kotlin.name.ClassId
|
import org.jetbrains.kotlin.name.ClassId
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
|
import org.jetbrains.kotlin.name.StandardClassIds
|
||||||
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
import org.jetbrains.kotlin.resolve.jvm.JvmClassName
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.IncompatibleVersionErrorData
|
import org.jetbrains.kotlin.serialization.deserialization.IncompatibleVersionErrorData
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.builtins.BuiltInSerializerProtocol
|
import org.jetbrains.kotlin.serialization.deserialization.builtins.BuiltInSerializerProtocol
|
||||||
@@ -159,9 +161,13 @@ class JvmClassFileBasedSymbolProvider(
|
|||||||
symbol: FirRegularClassSymbol
|
symbol: FirRegularClassSymbol
|
||||||
) {
|
) {
|
||||||
val annotations = mutableListOf<FirAnnotation>()
|
val annotations = mutableListOf<FirAnnotation>()
|
||||||
|
var hasPublishedApi = false
|
||||||
kotlinClass.kotlinJvmBinaryClass.loadClassAnnotations(
|
kotlinClass.kotlinJvmBinaryClass.loadClassAnnotations(
|
||||||
object : KotlinJvmBinaryClass.AnnotationVisitor {
|
object : KotlinJvmBinaryClass.AnnotationVisitor {
|
||||||
override fun visitAnnotation(classId: ClassId, source: SourceElement): KotlinJvmBinaryClass.AnnotationArgumentVisitor? {
|
override fun visitAnnotation(classId: ClassId, source: SourceElement): KotlinJvmBinaryClass.AnnotationArgumentVisitor? {
|
||||||
|
if (classId == StandardClassIds.Annotations.PublishedApi) {
|
||||||
|
hasPublishedApi = true
|
||||||
|
}
|
||||||
return annotationsLoader.loadAnnotationIfNotSpecial(classId, annotations)
|
return annotationsLoader.loadAnnotationIfNotSpecial(classId, annotations)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -170,8 +176,11 @@ class JvmClassFileBasedSymbolProvider(
|
|||||||
},
|
},
|
||||||
kotlinClass.byteContent,
|
kotlinClass.byteContent,
|
||||||
)
|
)
|
||||||
symbol.fir.replaceAnnotations(annotations.toMutableOrEmpty())
|
symbol.fir.run {
|
||||||
symbol.fir.replaceDeprecationsProvider(symbol.fir.getDeprecationsProvider(session))
|
replaceAnnotations(annotations.toMutableOrEmpty())
|
||||||
|
replaceDeprecationsProvider(symbol.fir.getDeprecationsProvider(session))
|
||||||
|
setLazyPublishedVisibility(hasPublishedApi, null, session)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun String?.toPath(): Path? {
|
private fun String?.toPath(): Path? {
|
||||||
|
|||||||
+13
-20
@@ -26,9 +26,7 @@ import org.jetbrains.kotlin.fir.scopes.unsubstitutedScope
|
|||||||
import org.jetbrains.kotlin.fir.toEffectiveVisibility
|
import org.jetbrains.kotlin.fir.toEffectiveVisibility
|
||||||
import org.jetbrains.kotlin.fir.types.*
|
import org.jetbrains.kotlin.fir.types.*
|
||||||
import org.jetbrains.kotlin.fir.visibilityChecker
|
import org.jetbrains.kotlin.fir.visibilityChecker
|
||||||
import org.jetbrains.kotlin.name.StandardClassIds
|
|
||||||
import org.jetbrains.kotlin.types.Variance
|
import org.jetbrains.kotlin.types.Variance
|
||||||
import org.jetbrains.kotlin.utils.addToStdlib.runIf
|
|
||||||
|
|
||||||
class FirStatusResolver(
|
class FirStatusResolver(
|
||||||
val session: FirSession,
|
val session: FirSession,
|
||||||
@@ -290,28 +288,23 @@ class FirStatusResolver(
|
|||||||
)
|
)
|
||||||
val effectiveVisibility = parentEffectiveVisibility.lowerBound(selfEffectiveVisibility, session.typeContext)
|
val effectiveVisibility = parentEffectiveVisibility.lowerBound(selfEffectiveVisibility, session.typeContext)
|
||||||
val annotations = (containingProperty ?: declaration).annotations
|
val annotations = (containingProperty ?: declaration).annotations
|
||||||
|
val parentPublishedEffectiveVisibility = when {
|
||||||
val hasPublishedApiAnnotation = annotations.any {
|
|
||||||
it.typeRef.coneTypeSafe<ConeClassLikeType>()?.lookupTag?.classId == StandardClassIds.Annotations.PublishedApi
|
|
||||||
}
|
|
||||||
|
|
||||||
var selfPublishedEffectiveVisibility = runIf(hasPublishedApiAnnotation) {
|
|
||||||
visibility.toEffectiveVisibility(
|
|
||||||
containingClass?.symbol?.toLookupTag(), forClass = declaration is FirClass, ownerIsPublishedApi = true
|
|
||||||
)
|
|
||||||
}
|
|
||||||
var parentPublishedEffectiveVisibility = when {
|
|
||||||
containingProperty != null -> containingProperty.publishedApiEffectiveVisibility
|
containingProperty != null -> containingProperty.publishedApiEffectiveVisibility
|
||||||
containingClass is FirRegularClass -> containingClass.publishedApiEffectiveVisibility
|
containingClass is FirRegularClass -> containingClass.publishedApiEffectiveVisibility
|
||||||
else -> null
|
else -> null
|
||||||
}
|
}
|
||||||
if (selfPublishedEffectiveVisibility != null || parentPublishedEffectiveVisibility != null) {
|
|
||||||
selfPublishedEffectiveVisibility = selfPublishedEffectiveVisibility ?: selfEffectiveVisibility
|
computePublishedApiEffectiveVisibility(
|
||||||
parentPublishedEffectiveVisibility = parentPublishedEffectiveVisibility ?: parentEffectiveVisibility
|
annotations,
|
||||||
declaration.publishedApiEffectiveVisibility = parentPublishedEffectiveVisibility.lowerBound(
|
visibility,
|
||||||
selfPublishedEffectiveVisibility,
|
selfEffectiveVisibility,
|
||||||
session.typeContext
|
containingClass?.symbol,
|
||||||
)
|
parentEffectiveVisibility,
|
||||||
|
parentPublishedEffectiveVisibility,
|
||||||
|
declaration is FirClass,
|
||||||
|
session
|
||||||
|
)?.let {
|
||||||
|
declaration.nonLazyPublishedApiEffectiveVisibility = it
|
||||||
}
|
}
|
||||||
|
|
||||||
if (containingClass is FirRegularClass && containingClass.isExpect) {
|
if (containingClass is FirRegularClass && containingClass.isExpect) {
|
||||||
|
|||||||
+126
-6
@@ -6,20 +6,140 @@
|
|||||||
package org.jetbrains.kotlin.fir.resolve.transformers
|
package org.jetbrains.kotlin.fir.resolve.transformers
|
||||||
|
|
||||||
import org.jetbrains.kotlin.descriptors.EffectiveVisibility
|
import org.jetbrains.kotlin.descriptors.EffectiveVisibility
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirDeclaration
|
import org.jetbrains.kotlin.descriptors.Visibility
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationDataKey
|
import org.jetbrains.kotlin.fir.FirSession
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirDeclarationDataRegistry
|
import org.jetbrains.kotlin.fir.declarations.*
|
||||||
import org.jetbrains.kotlin.fir.declarations.FirResolvePhase
|
import org.jetbrains.kotlin.fir.declarations.utils.classId
|
||||||
|
import org.jetbrains.kotlin.fir.declarations.utils.effectiveVisibility
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.FirAnnotation
|
||||||
|
import org.jetbrains.kotlin.fir.expressions.unexpandedClassId
|
||||||
|
import org.jetbrains.kotlin.fir.resolve.toSymbol
|
||||||
|
import org.jetbrains.kotlin.fir.symbols.ConeClassLikeLookupTag
|
||||||
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
import org.jetbrains.kotlin.fir.symbols.FirBasedSymbol
|
||||||
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
import org.jetbrains.kotlin.fir.symbols.lazyResolveToPhase
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
|
||||||
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
||||||
|
import org.jetbrains.kotlin.fir.symbols.impl.FirClassSymbol
|
||||||
|
import org.jetbrains.kotlin.fir.toEffectiveVisibility
|
||||||
|
import org.jetbrains.kotlin.fir.types.ConeClassLikeType
|
||||||
|
import org.jetbrains.kotlin.fir.types.coneTypeSafe
|
||||||
|
import org.jetbrains.kotlin.fir.types.toLookupTag
|
||||||
|
import org.jetbrains.kotlin.fir.types.typeContext
|
||||||
|
import org.jetbrains.kotlin.name.StandardClassIds
|
||||||
|
import org.jetbrains.kotlin.utils.addToStdlib.runIf
|
||||||
|
|
||||||
private object PublishedApiEffectiveVisibilityKey : FirDeclarationDataKey()
|
private object PublishedApiEffectiveVisibilityKey : FirDeclarationDataKey()
|
||||||
var FirDeclaration.publishedApiEffectiveVisibility: EffectiveVisibility? by FirDeclarationDataRegistry.data(PublishedApiEffectiveVisibilityKey)
|
private object LazyPublishedApiEffectiveVisibilityKey : FirDeclarationDataKey()
|
||||||
|
|
||||||
|
var FirDeclaration.nonLazyPublishedApiEffectiveVisibility: EffectiveVisibility? by FirDeclarationDataRegistry.data(
|
||||||
|
PublishedApiEffectiveVisibilityKey
|
||||||
|
)
|
||||||
|
var FirDeclaration.lazyPublishedApiEffectiveVisibility: Lazy<EffectiveVisibility?>? by FirDeclarationDataRegistry.data(
|
||||||
|
LazyPublishedApiEffectiveVisibilityKey
|
||||||
|
)
|
||||||
|
|
||||||
|
val FirDeclaration.publishedApiEffectiveVisibility: EffectiveVisibility?
|
||||||
|
get() = nonLazyPublishedApiEffectiveVisibility ?: lazyPublishedApiEffectiveVisibility?.value
|
||||||
|
|
||||||
inline val FirBasedSymbol<*>.publishedApiEffectiveVisibility: EffectiveVisibility?
|
inline val FirBasedSymbol<*>.publishedApiEffectiveVisibility: EffectiveVisibility?
|
||||||
get() {
|
get() {
|
||||||
lazyResolveToPhase(FirResolvePhase.STATUS)
|
lazyResolveToPhase(FirResolvePhase.STATUS)
|
||||||
return fir.publishedApiEffectiveVisibility
|
return fir.publishedApiEffectiveVisibility
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun computePublishedApiEffectiveVisibility(
|
||||||
|
annotations: List<FirAnnotation>,
|
||||||
|
visibility: Visibility,
|
||||||
|
selfEffectiveVisibility: EffectiveVisibility,
|
||||||
|
containingClassSymbol: FirClassLikeSymbol<*>?,
|
||||||
|
parentEffectiveVisibility: EffectiveVisibility,
|
||||||
|
parentPublishedEffectiveVisibility: EffectiveVisibility?,
|
||||||
|
forClass: Boolean,
|
||||||
|
session: FirSession,
|
||||||
|
): EffectiveVisibility? {
|
||||||
|
val hasPublishedApiAnnotation = annotations.any {
|
||||||
|
it.typeRef.coneTypeSafe<ConeClassLikeType>()?.lookupTag?.classId == StandardClassIds.Annotations.PublishedApi
|
||||||
|
}
|
||||||
|
|
||||||
|
return computePublishedApiEffectiveVisibility(
|
||||||
|
hasPublishedApiAnnotation,
|
||||||
|
visibility,
|
||||||
|
selfEffectiveVisibility,
|
||||||
|
containingClassSymbol?.toLookupTag(),
|
||||||
|
parentEffectiveVisibility,
|
||||||
|
parentPublishedEffectiveVisibility,
|
||||||
|
forClass,
|
||||||
|
session
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun computePublishedApiEffectiveVisibility(
|
||||||
|
hasPublishedApiAnnotation: Boolean,
|
||||||
|
visibility: Visibility,
|
||||||
|
selfEffectiveVisibility: EffectiveVisibility,
|
||||||
|
containingClassLookupTag: ConeClassLikeLookupTag?,
|
||||||
|
parentEffectiveVisibility: EffectiveVisibility,
|
||||||
|
parentPublishedEffectiveVisibility: EffectiveVisibility?,
|
||||||
|
forClass: Boolean,
|
||||||
|
session: FirSession,
|
||||||
|
): EffectiveVisibility? {
|
||||||
|
val selfPublishedEffectiveVisibility = runIf(hasPublishedApiAnnotation) {
|
||||||
|
visibility.toEffectiveVisibility(
|
||||||
|
containingClassLookupTag, forClass = forClass, ownerIsPublishedApi = true
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selfPublishedEffectiveVisibility != null || parentPublishedEffectiveVisibility != null) {
|
||||||
|
return (parentPublishedEffectiveVisibility ?: parentEffectiveVisibility).lowerBound(
|
||||||
|
(selfPublishedEffectiveVisibility ?: selfEffectiveVisibility),
|
||||||
|
session.typeContext
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Published visibility depends on the published visibility of the containing class.
|
||||||
|
* However, the published visibility of deserialized classes can't be eagerly determined because it depends on their annotations, which
|
||||||
|
* are loaded later to prevent endless loops.
|
||||||
|
* To break up this dependency, the published visibility can be computed lazily when containing classes are fully deserialized.
|
||||||
|
*/
|
||||||
|
fun FirMemberDeclaration.setLazyPublishedVisibility(session: FirSession) {
|
||||||
|
setLazyPublishedVisibility(annotations, null, session)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun FirMemberDeclaration.setLazyPublishedVisibility(annotations: List<FirAnnotation>, parentProperty: FirProperty?, session: FirSession) {
|
||||||
|
setLazyPublishedVisibility(
|
||||||
|
hasPublishedApi = annotations.any { it.unexpandedClassId == StandardClassIds.Annotations.PublishedApi },
|
||||||
|
parentProperty,
|
||||||
|
session
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun FirMemberDeclaration.setLazyPublishedVisibility(hasPublishedApi: Boolean, parentProperty: FirProperty?, session: FirSession) {
|
||||||
|
if (!hasPublishedApi) return
|
||||||
|
|
||||||
|
lazyPublishedApiEffectiveVisibility = lazy {
|
||||||
|
val containingClassLookupTag = (when {
|
||||||
|
parentProperty != null -> parentProperty.symbol.callableId.classId
|
||||||
|
this is FirClassLikeDeclaration -> classId.parentClassId
|
||||||
|
this is FirCallableDeclaration -> symbol.callableId.classId
|
||||||
|
else -> null
|
||||||
|
})?.toLookupTag()
|
||||||
|
|
||||||
|
val status = status as FirResolvedDeclarationStatus
|
||||||
|
val parentSymbol = containingClassLookupTag?.toSymbol(session)
|
||||||
|
computePublishedApiEffectiveVisibility(
|
||||||
|
hasPublishedApiAnnotation = true,
|
||||||
|
visibility = status.visibility,
|
||||||
|
selfEffectiveVisibility = status.effectiveVisibility,
|
||||||
|
containingClassLookupTag = containingClassLookupTag,
|
||||||
|
parentEffectiveVisibility = parentProperty?.effectiveVisibility ?: parentSymbol?.effectiveVisibility
|
||||||
|
?: EffectiveVisibility.Public,
|
||||||
|
parentPublishedEffectiveVisibility = parentProperty?.publishedApiEffectiveVisibility
|
||||||
|
?: parentSymbol?.publishedApiEffectiveVisibility,
|
||||||
|
forClass = this is FirClass,
|
||||||
|
session = session,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
+12
-6
@@ -14,25 +14,31 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirClassLikeSymbol
|
|||||||
open class FirDeclarationRendererWithAttributes : FirDeclarationRenderer() {
|
open class FirDeclarationRendererWithAttributes : FirDeclarationRenderer() {
|
||||||
override fun FirDeclaration.renderDeclarationAttributes() {
|
override fun FirDeclaration.renderDeclarationAttributes() {
|
||||||
if (attributes.isNotEmpty()) {
|
if (attributes.isNotEmpty()) {
|
||||||
val attributes = getAttributesWithValues().mapNotNull { (klass, value) ->
|
val attributes = getAttributesWithValues()
|
||||||
value?.let { klass to value.renderAsDeclarationAttributeValue() }
|
.mapNotNull { (klass, value) -> value?.let { klass to value.renderAsDeclarationAttributeValue() } }
|
||||||
}.joinToString { (name, value) -> "$name=$value" }
|
.ifEmpty { return }
|
||||||
|
.joinToString { (name, value) -> "$name=$value" }
|
||||||
printer.print("[$attributes] ")
|
printer.print("[$attributes] ")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun FirDeclaration.getAttributesWithValues(): List<Pair<String, Any?>> {
|
private fun FirDeclaration.getAttributesWithValues(): List<Pair<String, Any?>> {
|
||||||
val attributesMap = FirDeclarationDataRegistry.allValuesThreadUnsafeForRendering()
|
return attributeTypesToIds()
|
||||||
return attributesMap.entries
|
|
||||||
.map { it.key.substringAfterLast(".") to it.value }
|
|
||||||
.sortedBy { it.first }
|
.sortedBy { it.first }
|
||||||
.map { (klass, index) -> klass to attributes[index] }
|
.map { (klass, index) -> klass to attributes[index] }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected open fun attributeTypesToIds(): List<Pair<String, Int>> {
|
||||||
|
val attributeMap = FirDeclarationDataRegistry.allValuesThreadUnsafeForRendering()
|
||||||
|
return attributeMap.entries
|
||||||
|
.map { it.key.substringAfterLast(".") to it.value }
|
||||||
|
}
|
||||||
|
|
||||||
private fun Any.renderAsDeclarationAttributeValue() = when (this) {
|
private fun Any.renderAsDeclarationAttributeValue() = when (this) {
|
||||||
is FirCallableSymbol<*> -> callableId.toString()
|
is FirCallableSymbol<*> -> callableId.toString()
|
||||||
is FirClassLikeSymbol<*> -> classId.asString()
|
is FirClassLikeSymbol<*> -> classId.asString()
|
||||||
is FirProperty -> symbol.callableId.toString()
|
is FirProperty -> symbol.callableId.toString()
|
||||||
|
is Lazy<*> -> value.toString()
|
||||||
else -> toString()
|
else -> toString()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2023 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||||
|
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.fir.renderer
|
||||||
|
|
||||||
|
class FirDeclarationRendererWithFilteredAttributes : FirDeclarationRendererWithAttributes() {
|
||||||
|
override fun attributeTypesToIds(): List<Pair<String, Int>> {
|
||||||
|
return super.attributeTypesToIds().filter { it.first !in IGNORED_ATTRIBUTES }
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
private val IGNORED_ATTRIBUTES = setOf("FirVersionRequirementsTableKey", "SourceElementKey")
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// MODULE: lib
|
||||||
|
// FILE: lib.kt
|
||||||
|
@PublishedApi
|
||||||
|
internal fun published() = "OK"
|
||||||
|
|
||||||
|
// MODULE: main()(lib)()
|
||||||
|
// FILE: main.kt
|
||||||
|
inline fun callTest() = published()
|
||||||
|
|
||||||
|
fun box() = callTest()
|
||||||
+92
@@ -0,0 +1,92 @@
|
|||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false] class Internal : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Internal] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] val prop: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] constructor(): R|test/Internal|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] constructor(foo: R|kotlin/String|): R|test/Internal|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=internal] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Internal.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false] class Public : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Public] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] constructor(): R|test/Public|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] constructor(foo: R|kotlin/String|): R|test/Public|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Public.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Published : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Published] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] constructor(): R|test/Published|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] constructor(foo: R|kotlin/String|): R|test/Published|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Published.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+92
@@ -0,0 +1,92 @@
|
|||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false] class Internal : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Internal] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] val prop: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] constructor(foo: R|kotlin/String|): R|test/Internal|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] constructor(): R|test/Internal|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=internal] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Internal.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false] class Public : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Public] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] constructor(foo: R|kotlin/String|): R|test/Public|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] constructor(): R|test/Public|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Public.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Published : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Published] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] constructor(foo: R|kotlin/String|): R|test/Published|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] constructor(): R|test/Published|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Published.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+92
@@ -0,0 +1,92 @@
|
|||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int| = Int(1)
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false] class Internal : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Internal] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] val prop: R|kotlin/Int| = Int(1)
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=internal] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] constructor(foo: R|kotlin/String|): R|test/Internal|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Internal, LazyPublishedApiEffectiveVisibilityKey=internal] constructor(): R|test/Internal|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=internal] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Internal.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false] class Public : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Public] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int| = Int(1)
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] constructor(foo: R|kotlin/String|): R|test/Public|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Public, LazyPublishedApiEffectiveVisibilityKey=public] constructor(): R|test/Public|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Public.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Published : R|kotlin/Any| {
|
||||||
|
@R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] fun method(): R|kotlin/Unit|
|
||||||
|
|
||||||
|
public final val foo: R|kotlin/String|
|
||||||
|
public [ContainingClassKey=Published] get(): R|kotlin/String|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop: R|kotlin/Int| = Int(1)
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] val prop2: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
|
||||||
|
@PROPERTY:R|kotlin/PublishedApi|() internal final [LazyPublishedApiEffectiveVisibilityKey=public] var prop3: R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] get(): R|kotlin/Int|
|
||||||
|
internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] set(value: R|kotlin/Int|): R|kotlin/Unit|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] constructor(foo: R|kotlin/String|): R|test/Published|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal [ContainingClassKey=Published, LazyPublishedApiEffectiveVisibilityKey=public] constructor(): R|test/Published|
|
||||||
|
|
||||||
|
@R|kotlin/PublishedApi|() internal final [HasNoEnumEntriesKey=true, IsNewPlaceForBodyGeneration=false, LazyPublishedApiEffectiveVisibilityKey=public] class Nested : R|kotlin/Any| {
|
||||||
|
public [ContainingClassKey=Nested] constructor(): R|test/Published.Nested|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
// RENDER_FIR_DECLARATION_ATTRIBUTES
|
||||||
|
// PLATFORM_DEPENDANT_METADATA
|
||||||
|
// NO_CHECK_SOURCE_VS_BINARY
|
||||||
|
// SKIP_IN_RUNTIME_TEST
|
||||||
|
|
||||||
|
package test
|
||||||
|
|
||||||
|
internal class Internal @PublishedApi internal constructor(val foo: String) {
|
||||||
|
@PublishedApi internal constructor() : this("")
|
||||||
|
@PublishedApi internal fun method() {}
|
||||||
|
@PublishedApi internal val prop: Int = 1
|
||||||
|
@PublishedApi internal val prop2: Int get() = 1
|
||||||
|
@PublishedApi internal var prop3: Int = 1
|
||||||
|
set(value) {}
|
||||||
|
|
||||||
|
@PublishedApi internal class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
class Public @PublishedApi internal constructor(val foo: String) {
|
||||||
|
@PublishedApi internal constructor() : this("")
|
||||||
|
@PublishedApi internal fun method() {}
|
||||||
|
@PublishedApi internal val prop: Int = 1
|
||||||
|
@PublishedApi internal val prop2: Int get() = 1
|
||||||
|
@PublishedApi internal var prop3: Int = 1
|
||||||
|
set(value) {}
|
||||||
|
|
||||||
|
@PublishedApi internal class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublishedApi
|
||||||
|
internal class Published @PublishedApi internal constructor(val foo: String) {
|
||||||
|
@PublishedApi internal constructor() : this("")
|
||||||
|
@PublishedApi internal fun method() {}
|
||||||
|
@PublishedApi internal val prop: Int = 1
|
||||||
|
@PublishedApi internal val prop2: Int get() = 1
|
||||||
|
@PublishedApi internal var prop3: Int = 1
|
||||||
|
set(value) {}
|
||||||
|
|
||||||
|
@PublishedApi internal class Nested
|
||||||
|
}
|
||||||
|
|
||||||
|
@PublishedApi internal fun method() {}
|
||||||
|
@PublishedApi internal val prop: Int = 1
|
||||||
|
@PublishedApi internal val prop2: Int get() = 1
|
||||||
|
@PublishedApi internal var prop3: Int = 1
|
||||||
|
set(value) {}
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
package test
|
||||||
|
|
||||||
|
@kotlin.PublishedApi internal val prop: kotlin.Int
|
||||||
|
internal fun `<get-prop>`(): kotlin.Int
|
||||||
|
@kotlin.PublishedApi internal val prop2: kotlin.Int
|
||||||
|
internal fun `<get-prop2>`(): kotlin.Int
|
||||||
|
@kotlin.PublishedApi internal var prop3: kotlin.Int
|
||||||
|
internal fun `<get-prop3>`(): kotlin.Int
|
||||||
|
internal fun `<set-prop3>`(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||||
|
@kotlin.PublishedApi internal fun method(): kotlin.Unit
|
||||||
|
|
||||||
|
internal final class Internal {
|
||||||
|
@kotlin.PublishedApi internal constructor Internal()
|
||||||
|
/*primary*/ @kotlin.PublishedApi internal constructor Internal(/*0*/ foo: kotlin.String)
|
||||||
|
public final val foo: kotlin.String
|
||||||
|
public final fun `<get-foo>`(): kotlin.String
|
||||||
|
@kotlin.PublishedApi internal final val prop: kotlin.Int
|
||||||
|
internal final fun `<get-prop>`(): kotlin.Int
|
||||||
|
@kotlin.PublishedApi internal final val prop2: kotlin.Int
|
||||||
|
internal final fun `<get-prop2>`(): kotlin.Int
|
||||||
|
@kotlin.PublishedApi internal final var prop3: kotlin.Int
|
||||||
|
internal final fun `<get-prop3>`(): kotlin.Int
|
||||||
|
internal final fun `<set-prop3>`(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||||
|
@kotlin.PublishedApi internal final fun method(): kotlin.Unit
|
||||||
|
|
||||||
|
@kotlin.PublishedApi internal final class Nested {
|
||||||
|
/*primary*/ public constructor Nested()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class Public {
|
||||||
|
@kotlin.PublishedApi internal constructor Public()
|
||||||
|
/*primary*/ @kotlin.PublishedApi internal constructor Public(/*0*/ foo: kotlin.String)
|
||||||
|
public final val foo: kotlin.String
|
||||||
|
public final fun `<get-foo>`(): kotlin.String
|
||||||
|
@kotlin.PublishedApi internal final val prop: kotlin.Int
|
||||||
|
internal final fun `<get-prop>`(): kotlin.Int
|
||||||
|
@kotlin.PublishedApi internal final val prop2: kotlin.Int
|
||||||
|
internal final fun `<get-prop2>`(): kotlin.Int
|
||||||
|
@kotlin.PublishedApi internal final var prop3: kotlin.Int
|
||||||
|
internal final fun `<get-prop3>`(): kotlin.Int
|
||||||
|
internal final fun `<set-prop3>`(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||||
|
@kotlin.PublishedApi internal final fun method(): kotlin.Unit
|
||||||
|
|
||||||
|
@kotlin.PublishedApi internal final class Nested {
|
||||||
|
/*primary*/ public constructor Nested()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@kotlin.PublishedApi internal final class Published {
|
||||||
|
@kotlin.PublishedApi internal constructor Published()
|
||||||
|
/*primary*/ @kotlin.PublishedApi internal constructor Published(/*0*/ foo: kotlin.String)
|
||||||
|
public final val foo: kotlin.String
|
||||||
|
public final fun `<get-foo>`(): kotlin.String
|
||||||
|
@kotlin.PublishedApi internal final val prop: kotlin.Int
|
||||||
|
internal final fun `<get-prop>`(): kotlin.Int
|
||||||
|
@kotlin.PublishedApi internal final val prop2: kotlin.Int
|
||||||
|
internal final fun `<get-prop2>`(): kotlin.Int
|
||||||
|
@kotlin.PublishedApi internal final var prop3: kotlin.Int
|
||||||
|
internal final fun `<get-prop3>`(): kotlin.Int
|
||||||
|
internal final fun `<set-prop3>`(/*0*/ value: kotlin.Int): kotlin.Unit
|
||||||
|
@kotlin.PublishedApi internal final fun method(): kotlin.Unit
|
||||||
|
|
||||||
|
@kotlin.PublishedApi internal final class Nested {
|
||||||
|
/*primary*/ public constructor Nested()
|
||||||
|
}
|
||||||
|
}
|
||||||
+6
@@ -35611,6 +35611,12 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("noMangling.kt")
|
@TestMetadata("noMangling.kt")
|
||||||
public void testNoMangling() throws Exception {
|
public void testNoMangling() throws Exception {
|
||||||
|
|||||||
+6
@@ -37387,6 +37387,12 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("noMangling.kt")
|
@TestMetadata("noMangling.kt")
|
||||||
public void testNoMangling() throws Exception {
|
public void testNoMangling() throws Exception {
|
||||||
|
|||||||
+6
@@ -37387,6 +37387,12 @@ public class IrBlackBoxCodegenWithIrInlinerTestGenerated extends AbstractIrBlack
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("noMangling.kt")
|
@TestMetadata("noMangling.kt")
|
||||||
public void testNoMangling() throws Exception {
|
public void testNoMangling() throws Exception {
|
||||||
|
|||||||
+6
@@ -88,6 +88,12 @@ object FirDiagnosticsDirectives : SimpleDirectivesContainer() {
|
|||||||
See AbstractLoadedMetadataDumpHandler
|
See AbstractLoadedMetadataDumpHandler
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val RENDER_FIR_DECLARATION_ATTRIBUTES by directive(
|
||||||
|
description = """
|
||||||
|
Prints declaration attributes to dumps in load compiled kotlin tests
|
||||||
|
"""
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun TestConfigurationBuilder.configureFirParser(parser: FirParser) {
|
fun TestConfigurationBuilder.configureFirParser(parser: FirParser) {
|
||||||
|
|||||||
+5
@@ -30462,6 +30462,11 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("noMangling.kt")
|
@TestMetadata("noMangling.kt")
|
||||||
public void testNoMangling() throws Exception {
|
public void testNoMangling() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/publishedApi/noMangling.kt");
|
runTest("compiler/testData/codegen/box/publishedApi/noMangling.kt");
|
||||||
|
|||||||
+5
@@ -4554,6 +4554,11 @@ public class LoadJavaTestGenerated extends AbstractLoadJavaTest {
|
|||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PublishedApi.kt")
|
||||||
|
public void testPublishedApi() throws Exception {
|
||||||
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PublishedApi.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
||||||
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
||||||
|
|||||||
Generated
+5
@@ -2866,6 +2866,11 @@ public class LoadKotlinWithTypeTableTestGenerated extends AbstractLoadKotlinWith
|
|||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PublishedApi.kt")
|
||||||
|
public void testPublishedApi() throws Exception {
|
||||||
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PublishedApi.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
||||||
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
||||||
|
|||||||
+5
@@ -4555,6 +4555,11 @@ public class IrLoadJavaTestGenerated extends AbstractIrLoadJavaTest {
|
|||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PublishedApi.kt")
|
||||||
|
public void testPublishedApi() throws Exception {
|
||||||
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PublishedApi.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
||||||
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
||||||
|
|||||||
Generated
+5
@@ -4554,6 +4554,11 @@ public class LoadJavaUsingJavacTestGenerated extends AbstractLoadJavaUsingJavacT
|
|||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PublishedApi.kt")
|
||||||
|
public void testPublishedApi() throws Exception {
|
||||||
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PublishedApi.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
||||||
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
||||||
|
|||||||
+5
@@ -2868,6 +2868,11 @@ public class JvmRuntimeDescriptorLoaderTestGenerated extends AbstractJvmRuntimeD
|
|||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("PublishedApi.kt")
|
||||||
|
public void testPublishedApi() throws Exception {
|
||||||
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PublishedApi.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
||||||
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/TopLevelVarWithPrivateSetter.kt");
|
||||||
|
|||||||
+6
@@ -26437,6 +26437,12 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
+6
@@ -26725,6 +26725,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
Generated
+6
@@ -2836,6 +2836,12 @@ public class FirLoadK2CompiledJsKotlinTestGenerated extends AbstractFirLoadK2Com
|
|||||||
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PropertyInConstructorExplicitVisibility.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("PublishedApi.kt")
|
||||||
|
public void testPublishedApi() throws Exception {
|
||||||
|
runTest("compiler/testData/loadJava/compiledKotlin/visibility/PublishedApi.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
@TestMetadata("TopLevelVarWithPrivateSetter.kt")
|
||||||
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
public void testTopLevelVarWithPrivateSetter() throws Exception {
|
||||||
|
|||||||
+6
@@ -26725,6 +26725,12 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
+6
@@ -26725,6 +26725,12 @@ public class IrJsES6CodegenBoxTestGenerated extends AbstractIrJsES6CodegenBoxTes
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
+6
@@ -29866,6 +29866,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
+6
@@ -30542,6 +30542,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
+6
@@ -29529,6 +29529,12 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
+6
@@ -29867,6 +29867,12 @@ public class NativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenBoxT
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.NATIVE, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
|
|||||||
Generated
+5
@@ -23700,6 +23700,11 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
|||||||
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/publishedApi"), Pattern.compile("^([^_](.+))\\.kt$"), null, TargetBackend.WASM, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("inlineFromFriendModule.kt")
|
||||||
|
public void testInlineFromFriendModule() throws Exception {
|
||||||
|
runTest("compiler/testData/codegen/box/publishedApi/inlineFromFriendModule.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("simple.kt")
|
@TestMetadata("simple.kt")
|
||||||
public void testSimple() throws Exception {
|
public void testSimple() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/publishedApi/simple.kt");
|
runTest("compiler/testData/codegen/box/publishedApi/simple.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user