From 113d2653aac4ead7b38b004a0c93905d564d376e Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Mon, 12 Jul 2021 19:37:16 +0300 Subject: [PATCH] Drop deprecated -Xexperimental flag from compiler and tests --- .../kotlin/codegen/ClassFileFactory.java | 34 ------------------ .../arguments/CommonCompilerArguments.kt | 12 ------- .../jetbrains/kotlin/config/AnalysisFlags.kt | 3 -- ...irOldFrontendDiagnosticsTestGenerated.java | 6 ---- ...DiagnosticsWithLightTreeTestGenerated.java | 6 ---- .../checkers/ExperimentalUsageChecker.kt | 14 +++----- .../metadata/KlibMetadataSerializer.kt | 16 --------- .../LanguageVersionSettingsBuilder.kt | 1 - compiler/testData/cli/js/jsExtraHelp.out | 1 - ...lAndUseExperimentalWithSameAnnotation.args | 8 ----- ...talAndUseExperimentalWithSameAnnotation.kt | 4 --- ...alAndUseExperimentalWithSameAnnotation.out | 2 -- .../cli/jvm/experimentalDeprecated.args | 6 ++-- .../cli/jvm/experimentalDeprecated.kt | 16 +++------ .../cli/jvm/experimentalDeprecated.out | 6 ++-- .../jvm/experimentalDeprecatedWarning.args | 3 +- .../cli/jvm/experimentalDeprecatedWarning.kt | 9 ++--- .../cli/jvm/experimentalDeprecatedWarning.out | 4 +-- .../cli/jvm/experimentalIsNotAnnotation.args | 3 +- .../cli/jvm/experimentalIsNotAnnotation.out | 1 - .../cli/jvm/experimentalIsNotMarker.args | 3 +- .../cli/jvm/experimentalIsNotMarker.kt | 3 +- .../cli/jvm/experimentalIsNotMarker.out | 4 +-- .../testData/cli/jvm/experimentalNested.args | 2 +- .../testData/cli/jvm/experimentalNested.out | 1 - .../cli/jvm/experimentalUnresolved.args | 3 +- .../cli/jvm/experimentalUnresolved.out | 4 +-- compiler/testData/cli/jvm/extraHelp.out | 1 - .../experimental/experimentalOnWholeModule.kt | 25 ------------- .../experimentalOnWholeModule.txt | 21 ----------- .../jsExperimentalModule/lib/lib.kt | 8 ----- .../jsExperimentalModule/output.txt | 7 ---- .../jsExperimentalModule/usage.kt | 12 ------- .../jvmExperimentalModule/lib/lib.kt | 8 ----- .../jvmExperimentalModule/output.txt | 7 ---- .../jvmExperimentalModule/usage.kt | 12 ------- .../moduleProtoBuf/experimental/main.kt | 12 ------- .../experimental/module-proto.txt | 2 -- .../test/runners/DiagnosticTestGenerated.java | 6 ---- .../CompilerTestLanguageVersionSettings.kt | 1 - .../kotlin/cli/CliTestGenerated.java | 5 --- .../kotlin/codegen/JvmModuleProtoBufTest.kt | 11 ------ .../compiler/ExperimentalIntegrationTest.kt | 36 ------------------- ...CompilerTestFE10TestdataTestGenerated.java | 6 ---- .../js/KotlinJavascriptSerializationUtil.kt | 14 -------- 45 files changed, 25 insertions(+), 344 deletions(-) delete mode 100644 compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.args delete mode 100644 compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.kt delete mode 100644 compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.out delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.txt delete mode 100644 compiler/testData/experimental/jsExperimentalModule/lib/lib.kt delete mode 100644 compiler/testData/experimental/jsExperimentalModule/output.txt delete mode 100644 compiler/testData/experimental/jsExperimentalModule/usage.kt delete mode 100644 compiler/testData/experimental/jvmExperimentalModule/lib/lib.kt delete mode 100644 compiler/testData/experimental/jvmExperimentalModule/output.txt delete mode 100644 compiler/testData/experimental/jvmExperimentalModule/usage.kt delete mode 100644 compiler/testData/moduleProtoBuf/experimental/main.kt delete mode 100644 compiler/testData/moduleProtoBuf/experimental/module-proto.txt delete mode 100644 compiler/tests/org/jetbrains/kotlin/jvm/compiler/ExperimentalIntegrationTest.kt diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java index 68faeff9af6..796c3a76ecf 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ClassFileFactory.java @@ -27,24 +27,16 @@ import org.jetbrains.annotations.TestOnly; import org.jetbrains.kotlin.backend.common.output.OutputFile; import org.jetbrains.kotlin.backend.common.output.OutputFileCollection; import org.jetbrains.kotlin.codegen.state.GenerationState; -import org.jetbrains.kotlin.config.AnalysisFlags; import org.jetbrains.kotlin.config.JvmAnalysisFlags; -import org.jetbrains.kotlin.descriptors.ClassDescriptor; -import org.jetbrains.kotlin.descriptors.DescriptorUtilKt; -import org.jetbrains.kotlin.descriptors.ModuleDescriptor; -import org.jetbrains.kotlin.incremental.components.NoLookupLocation; import org.jetbrains.kotlin.load.kotlin.ModuleMappingUtilKt; import org.jetbrains.kotlin.metadata.ProtoBuf; import org.jetbrains.kotlin.metadata.jvm.JvmModuleProtoBuf; import org.jetbrains.kotlin.metadata.jvm.deserialization.ModuleMapping; import org.jetbrains.kotlin.metadata.jvm.deserialization.ModuleMappingKt; import org.jetbrains.kotlin.metadata.jvm.deserialization.PackageParts; -import org.jetbrains.kotlin.metadata.serialization.StringTable; -import org.jetbrains.kotlin.name.ClassId; import org.jetbrains.kotlin.name.FqName; import org.jetbrains.kotlin.psi.KtFile; import org.jetbrains.kotlin.resolve.CompilerDeserializationConfiguration; -import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt; import org.jetbrains.kotlin.resolve.jvm.diagnostics.JvmDeclarationOrigin; import org.jetbrains.kotlin.serialization.StringTableImpl; import org.jetbrains.org.objectweb.asm.Type; @@ -52,7 +44,6 @@ import org.jetbrains.org.objectweb.asm.Type; import java.io.File; import java.nio.charset.StandardCharsets; import java.util.*; -import java.util.concurrent.ConcurrentHashMap; import static org.jetbrains.kotlin.codegen.JvmCodegenUtil.getMappingFileName; @@ -134,11 +125,6 @@ public class ClassFileFactory implements OutputFileCollection { StringTableImpl stringTable = new StringTableImpl(); ClassFileUtilsKt.addDataFromCompiledModule(builder, packagePartRegistry, stringTable, state); - List experimental = state.getLanguageVersionSettings().getFlag(AnalysisFlags.getExperimental()); - if (!experimental.isEmpty()) { - writeExperimentalMarkers(state.getModule(), builder, experimental, stringTable); - } - Pair tables = stringTable.buildProto(); builder.setStringTable(tables.getFirst()); builder.setQualifiedNameTable(tables.getSecond()); @@ -162,26 +148,6 @@ public class ClassFileFactory implements OutputFileCollection { }); } - private static void writeExperimentalMarkers( - @NotNull ModuleDescriptor module, - @NotNull JvmModuleProtoBuf.Module.Builder builder, - @NotNull List experimental, - @NotNull StringTable stringTable - ) { - for (String fqName : experimental) { - ClassDescriptor descriptor = - DescriptorUtilKt.resolveClassByFqName(module, new FqName(fqName), NoLookupLocation.FOR_ALREADY_TRACKED); - if (descriptor != null) { - ProtoBuf.Annotation.Builder annotation = ProtoBuf.Annotation.newBuilder(); - ClassId classId = DescriptorUtilsKt.getClassId(descriptor); - if (classId != null) { - annotation.setId(stringTable.getQualifiedClassNameIndex(classId.asString(), false)); - builder.addAnnotation(annotation); - } - } - } - } - @NotNull @Override public List asList() { diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt index cedda032fa4..00e0235e38c 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.kt @@ -167,13 +167,6 @@ abstract class CommonCompilerArguments : CommonToolArguments() { ) var readDeserializedContracts: Boolean by FreezableVar(false) - @Argument( - value = "-Xexperimental", - valueDescription = "", - description = "Enable and propagate usages of experimental API for marker annotation with the given fully qualified name" - ) - var experimental: Array? by FreezableVar(null) - @Argument( value = "-Xuse-experimental", valueDescription = "", @@ -387,11 +380,6 @@ abstract class CommonCompilerArguments : CommonToolArguments() { put(AnalysisFlags.skipMetadataVersionCheck, skipMetadataVersionCheck) put(AnalysisFlags.skipPrereleaseCheck, skipPrereleaseCheck || skipMetadataVersionCheck) put(AnalysisFlags.multiPlatformDoNotCheckActual, noCheckActual) - val experimentalFqNames = experimental?.toList().orEmpty() - if (experimentalFqNames.isNotEmpty()) { - put(AnalysisFlags.experimental, experimentalFqNames) - collector.report(WARNING, "'-Xexperimental' is deprecated and will be removed in a future release") - } val useExperimentalFqNames = useExperimental?.toList().orEmpty() if (useExperimentalFqNames.isNotEmpty()) { collector.report( diff --git a/compiler/config/src/org/jetbrains/kotlin/config/AnalysisFlags.kt b/compiler/config/src/org/jetbrains/kotlin/config/AnalysisFlags.kt index b942e22d9f8..a6ee90e450f 100644 --- a/compiler/config/src/org/jetbrains/kotlin/config/AnalysisFlags.kt +++ b/compiler/config/src/org/jetbrains/kotlin/config/AnalysisFlags.kt @@ -18,9 +18,6 @@ object AnalysisFlags { @JvmStatic val expectActualLinker by AnalysisFlag.Delegates.Boolean - @JvmStatic - val experimental by AnalysisFlag.Delegates.ListOfStrings - @JvmStatic val useExperimental by AnalysisFlag.Delegates.ListOfStrings diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 5ae092dd2d3..ab0c6eb7dfb 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -34543,12 +34543,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalIsNotEnabled.kt"); } - @Test - @TestMetadata("experimentalOnWholeModule.kt") - public void testExperimentalOnWholeModule() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt"); - } - @Test @TestMetadata("fullFqNameUsage.kt") public void testFullFqNameUsage() throws Exception { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index 4f638967937..7fb11719874 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -34543,12 +34543,6 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalIsNotEnabled.kt"); } - @Test - @TestMetadata("experimentalOnWholeModule.kt") - public void testExperimentalOnWholeModule() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt"); - } - @Test @TestMetadata("fullFqNameUsage.kt") public void testFullFqNameUsage() throws Exception { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ExperimentalUsageChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ExperimentalUsageChecker.kt index 1e8d56627fe..6a8a0155347 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ExperimentalUsageChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/checkers/ExperimentalUsageChecker.kt @@ -272,8 +272,7 @@ class ExperimentalUsageChecker(project: Project) : CallChecker { languageVersionSettings: LanguageVersionSettings, bindingContext: BindingContext ): Boolean = - annotationFqName.asString() in languageVersionSettings.getFlag(AnalysisFlags.experimental) || - annotationFqName.asString() in languageVersionSettings.getFlag(AnalysisFlags.useExperimental) || + annotationFqName.asString() in languageVersionSettings.getFlag(AnalysisFlags.useExperimental) || anyParentMatches { element -> element.isDeclarationAnnotatedWith(annotationFqName, bindingContext) || element.isElementAnnotatedWithUseExperimentalOf(annotationFqName, bindingContext) @@ -348,13 +347,10 @@ class ExperimentalUsageChecker(project: Project) : CallChecker { return true } - val validExperimental = languageVersionSettings.getFlag(AnalysisFlags.experimental).filter(::checkAnnotation) - val validUseExperimental = languageVersionSettings.getFlag(AnalysisFlags.useExperimental).filter { fqName -> - fqName == REQUIRES_OPT_IN_FQ_NAME.asString() || fqName == OLD_EXPERIMENTAL_FQ_NAME.asString() || checkAnnotation(fqName) - } - - for (fqName in validExperimental.intersect(validUseExperimental)) { - reportError("'-Xopt-in=$fqName' has no effect because '-Xexperimental=$fqName' is used") + languageVersionSettings.getFlag(AnalysisFlags.useExperimental).forEach { fqName -> + if (fqName != REQUIRES_OPT_IN_FQ_NAME.asString() && fqName != OLD_EXPERIMENTAL_FQ_NAME.asString()) { + checkAnnotation(fqName) + } } } } diff --git a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/metadata/KlibMetadataSerializer.kt b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/metadata/KlibMetadataSerializer.kt index 06ab825154b..bd6f387186d 100644 --- a/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/metadata/KlibMetadataSerializer.kt +++ b/compiler/ir/serialization.common/src/org/jetbrains/kotlin/backend/common/serialization/metadata/KlibMetadataSerializer.kt @@ -8,11 +8,9 @@ package org.jetbrains.kotlin.backend.common.serialization.metadata import com.intellij.openapi.project.Project import org.jetbrains.kotlin.backend.common.serialization.isExpectMember import org.jetbrains.kotlin.backend.common.serialization.isSerializableExpectClass -import org.jetbrains.kotlin.config.AnalysisFlags import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.impl.ModuleDescriptorImpl -import org.jetbrains.kotlin.incremental.components.NoLookupLocation import org.jetbrains.kotlin.library.metadata.KlibMetadataProtoBuf import org.jetbrains.kotlin.metadata.ProtoBuf import org.jetbrains.kotlin.metadata.deserialization.BinaryVersion @@ -22,7 +20,6 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe import org.jetbrains.kotlin.resolve.scopes.DescriptorKindFilter import org.jetbrains.kotlin.serialization.ApproximatingStringTable import org.jetbrains.kotlin.serialization.DescriptorSerializer -import org.jetbrains.kotlin.serialization.StringTableImpl import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedClassDescriptor import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedPropertyDescriptor import org.jetbrains.kotlin.serialization.deserialization.descriptors.DeserializedSimpleFunctionDescriptor @@ -264,19 +261,6 @@ abstract class KlibMetadataSerializer( header.flags = 1 } - val experimentalAnnotationFqNames = languageVersionSettings.getFlag(AnalysisFlags.experimental) - if (experimentalAnnotationFqNames.isNotEmpty()) { - val stringTable = StringTableImpl() - for (fqName in experimentalAnnotationFqNames) { - val descriptor = moduleDescriptor.resolveClassByFqName(FqName(fqName), NoLookupLocation.FOR_ALREADY_TRACKED) ?: continue - header.addAnnotation(ProtoBuf.Annotation.newBuilder().apply { - id = stringTable.getFqNameIndex(descriptor) - }) - } - val (strings, qualifiedNames) = stringTable.buildProto() - header.strings = strings - header.qualifiedNames = qualifiedNames - } fragmentNames.forEach { header.addPackageFragmentName(it) } diff --git a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt index 76c214e60b0..43ee90e40f2 100644 --- a/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt +++ b/compiler/test-infrastructure/tests/org/jetbrains/kotlin/test/builders/LanguageVersionSettingsBuilder.kt @@ -63,7 +63,6 @@ class LanguageVersionSettingsBuilder { } val analysisFlags = listOfNotNull( - analysisFlag(AnalysisFlags.experimental, directives[LanguageSettingsDirectives.EXPERIMENTAL].takeIf { it.isNotEmpty() }), analysisFlag(AnalysisFlags.useExperimental, directives[LanguageSettingsDirectives.USE_EXPERIMENTAL].takeIf { it.isNotEmpty() }), analysisFlag(AnalysisFlags.ignoreDataFlowInAssert, trueOrNull(LanguageSettingsDirectives.IGNORE_DATA_FLOW_IN_ASSERT in directives)), analysisFlag(AnalysisFlags.constraintSystemForOverloadResolution, directives.singleOrZeroValue(LanguageSettingsDirectives.CONSTRAINT_SYSTEM_FOR_OVERLOAD_RESOLUTION)), diff --git a/compiler/testData/cli/js/jsExtraHelp.out b/compiler/testData/cli/js/jsExtraHelp.out index 02e0f0f0109..1c3d59c060a 100644 --- a/compiler/testData/cli/js/jsExtraHelp.out +++ b/compiler/testData/cli/js/jsExtraHelp.out @@ -50,7 +50,6 @@ where advanced options include: -Xdump-perf= Dump detailed performance statistics to the specified file -Xeffect-system Enable experimental language feature: effect system -Xexpect-actual-linker Enable experimental expect/actual linker - -Xexperimental= Enable and propagate usages of experimental API for marker annotation with the given fully qualified name -Xexplicit-api={strict|warning|disable} Force compiler to report errors on all public API declarations without explicit visibility or return type. Use 'warning' level to issue warnings instead of errors. diff --git a/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.args b/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.args deleted file mode 100644 index c545ab4b8f0..00000000000 --- a/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.args +++ /dev/null @@ -1,8 +0,0 @@ -$TESTDATA_DIR$/experimentalAndUseExperimentalWithSameAnnotation.kt --d -$TEMP_DIR$ --opt-in -kotlin.RequiresOptIn --opt-in -org.test.ExperimentalAPI --Xexperimental=org.test.ExperimentalAPI diff --git a/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.kt b/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.kt deleted file mode 100644 index 3ccd144f895..00000000000 --- a/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.kt +++ /dev/null @@ -1,4 +0,0 @@ -package org.test - -@RequiresOptIn -annotation class ExperimentalAPI diff --git a/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.out b/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.out deleted file mode 100644 index 21c63f40df3..00000000000 --- a/compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.out +++ /dev/null @@ -1,2 +0,0 @@ -error: '-Xopt-in=org.test.ExperimentalAPI' has no effect because '-Xexperimental=org.test.ExperimentalAPI' is used -COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/experimentalDeprecated.args b/compiler/testData/cli/jvm/experimentalDeprecated.args index f73e45b7bd2..8c037a079fd 100644 --- a/compiler/testData/cli/jvm/experimentalDeprecated.args +++ b/compiler/testData/cli/jvm/experimentalDeprecated.args @@ -2,7 +2,5 @@ $TESTDATA_DIR$/experimentalDeprecated.kt -d $TEMP_DIR$ -opt-in=kotlin.RequiresOptIn --Xexperimental=org.test.Error1 --Xexperimental=org.test.Hidden1 --opt-in=org.test.Error2 --opt-in=org.test.Hidden2 +-opt-in=org.test.Error +-opt-in=org.test.Hidden diff --git a/compiler/testData/cli/jvm/experimentalDeprecated.kt b/compiler/testData/cli/jvm/experimentalDeprecated.kt index 54b17ff1142..ea3b594d4fe 100644 --- a/compiler/testData/cli/jvm/experimentalDeprecated.kt +++ b/compiler/testData/cli/jvm/experimentalDeprecated.kt @@ -1,17 +1,9 @@ package org.test -@Deprecated("Error1", level = DeprecationLevel.ERROR) +@Deprecated("Error", level = DeprecationLevel.ERROR) @RequiresOptIn -annotation class Error1 +annotation class Error -@Deprecated("Error2", level = DeprecationLevel.ERROR) +@Deprecated("Hidden", level = DeprecationLevel.HIDDEN) @RequiresOptIn -annotation class Error2 - -@Deprecated("Hidden1", level = DeprecationLevel.HIDDEN) -@RequiresOptIn -annotation class Hidden1 - -@Deprecated("Hidden2", level = DeprecationLevel.HIDDEN) -@RequiresOptIn -annotation class Hidden2 +annotation class Hidden diff --git a/compiler/testData/cli/jvm/experimentalDeprecated.out b/compiler/testData/cli/jvm/experimentalDeprecated.out index 2dcf2329694..5556c4bab32 100644 --- a/compiler/testData/cli/jvm/experimentalDeprecated.out +++ b/compiler/testData/cli/jvm/experimentalDeprecated.out @@ -1,5 +1,3 @@ -error: opt-in requirement marker org.test.Error1 is deprecated. Error1 -error: opt-in requirement marker org.test.Hidden1 is deprecated. Hidden1 -error: opt-in requirement marker org.test.Error2 is deprecated. Error2 -error: opt-in requirement marker org.test.Hidden2 is deprecated. Hidden2 +error: opt-in requirement marker org.test.Error is deprecated. Error +error: opt-in requirement marker org.test.Hidden is deprecated. Hidden COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.args b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.args index cf413bd4db6..0d35c31cbd4 100644 --- a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.args +++ b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.args @@ -3,6 +3,5 @@ $TESTDATA_DIR$/experimentalDeprecatedWarning.kt $TEMP_DIR$ -Xopt-in=kotlin.RequiresOptIn -opt-in=kotlin.RequiresOptIn --opt-in=org.test.Warning1 --Xexperimental=org.test.Warning2 +-opt-in=org.test.Warning -Xuse-experimental=org.test.OneMore diff --git a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.kt b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.kt index d19ead74f08..c1f9b957c9a 100644 --- a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.kt +++ b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.kt @@ -1,14 +1,9 @@ package org.test -@Deprecated("Warning1", level = DeprecationLevel.WARNING) +@Deprecated("Warning", level = DeprecationLevel.WARNING) @RequiresOptIn @Retention(AnnotationRetention.BINARY) -annotation class Warning1 - -@Deprecated("Warning2", level = DeprecationLevel.WARNING) -@RequiresOptIn -@Retention(AnnotationRetention.BINARY) -annotation class Warning2 +annotation class Warning @RequiresOptIn annotation class OneMore diff --git a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.out b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.out index 48c04266a60..4cadf29b828 100644 --- a/compiler/testData/cli/jvm/experimentalDeprecatedWarning.out +++ b/compiler/testData/cli/jvm/experimentalDeprecatedWarning.out @@ -1,5 +1,3 @@ -warning: '-Xexperimental' is deprecated and will be removed in a future release warning: '-Xuse-experimental' is deprecated and will be removed in a future release, please use -opt-in instead -warning: opt-in requirement marker org.test.Warning2 is deprecated. Warning2 -warning: opt-in requirement marker org.test.Warning1 is deprecated. Warning1 +warning: opt-in requirement marker org.test.Warning is deprecated. Warning OK diff --git a/compiler/testData/cli/jvm/experimentalIsNotAnnotation.args b/compiler/testData/cli/jvm/experimentalIsNotAnnotation.args index a3dc5a0f1fb..fb4fd87e8d3 100644 --- a/compiler/testData/cli/jvm/experimentalIsNotAnnotation.args +++ b/compiler/testData/cli/jvm/experimentalIsNotAnnotation.args @@ -1,5 +1,6 @@ $TESTDATA_DIR$/experimentalIsNotAnnotation.kt -d $TEMP_DIR$ --Xexperimental=org.test.NotAnAnnotation1 +-opt-in +org.test.NotAnAnnotation1 -opt-in=org.test.NotAnAnnotation2 diff --git a/compiler/testData/cli/jvm/experimentalIsNotAnnotation.out b/compiler/testData/cli/jvm/experimentalIsNotAnnotation.out index 5744caeba0f..d6e2b0c05b2 100644 --- a/compiler/testData/cli/jvm/experimentalIsNotAnnotation.out +++ b/compiler/testData/cli/jvm/experimentalIsNotAnnotation.out @@ -1,4 +1,3 @@ -warning: '-Xexperimental' is deprecated and will be removed in a future release warning: class org.test.NotAnAnnotation1 is not an opt-in requirement marker warning: class org.test.NotAnAnnotation2 is not an opt-in requirement marker OK diff --git a/compiler/testData/cli/jvm/experimentalIsNotMarker.args b/compiler/testData/cli/jvm/experimentalIsNotMarker.args index 0e31da8c19c..83c9ebf6684 100644 --- a/compiler/testData/cli/jvm/experimentalIsNotMarker.args +++ b/compiler/testData/cli/jvm/experimentalIsNotMarker.args @@ -1,5 +1,4 @@ $TESTDATA_DIR$/experimentalIsNotMarker.kt -d $TEMP_DIR$ --Xexperimental=org.test.NotAMarker1 --opt-in=org.test.NotAMarker2 +-opt-in=org.test.NotAMarker diff --git a/compiler/testData/cli/jvm/experimentalIsNotMarker.kt b/compiler/testData/cli/jvm/experimentalIsNotMarker.kt index 5d2658dcd17..488e4c849bf 100644 --- a/compiler/testData/cli/jvm/experimentalIsNotMarker.kt +++ b/compiler/testData/cli/jvm/experimentalIsNotMarker.kt @@ -1,4 +1,3 @@ package org.test -annotation class NotAMarker1 -annotation class NotAMarker2 +annotation class NotAMarker diff --git a/compiler/testData/cli/jvm/experimentalIsNotMarker.out b/compiler/testData/cli/jvm/experimentalIsNotMarker.out index d42e2fc588e..e48b1d5ebe8 100644 --- a/compiler/testData/cli/jvm/experimentalIsNotMarker.out +++ b/compiler/testData/cli/jvm/experimentalIsNotMarker.out @@ -1,4 +1,2 @@ -warning: '-Xexperimental' is deprecated and will be removed in a future release -warning: class org.test.NotAMarker1 is not an opt-in requirement marker -warning: class org.test.NotAMarker2 is not an opt-in requirement marker +warning: class org.test.NotAMarker is not an opt-in requirement marker OK diff --git a/compiler/testData/cli/jvm/experimentalNested.args b/compiler/testData/cli/jvm/experimentalNested.args index bc6e40d5fc2..255feebde3b 100644 --- a/compiler/testData/cli/jvm/experimentalNested.args +++ b/compiler/testData/cli/jvm/experimentalNested.args @@ -2,4 +2,4 @@ $TESTDATA_DIR$/experimentalNested.kt -d $TEMP_DIR$ -opt-in=kotlin.RequiresOptIn --Xexperimental=org.test.Outer.Nested +-opt-in=org.test.Outer.Nested diff --git a/compiler/testData/cli/jvm/experimentalNested.out b/compiler/testData/cli/jvm/experimentalNested.out index 87440efb4ef..d86bac9de59 100644 --- a/compiler/testData/cli/jvm/experimentalNested.out +++ b/compiler/testData/cli/jvm/experimentalNested.out @@ -1,2 +1 @@ -warning: '-Xexperimental' is deprecated and will be removed in a future release OK diff --git a/compiler/testData/cli/jvm/experimentalUnresolved.args b/compiler/testData/cli/jvm/experimentalUnresolved.args index aa120426dab..163d1ca5f87 100644 --- a/compiler/testData/cli/jvm/experimentalUnresolved.args +++ b/compiler/testData/cli/jvm/experimentalUnresolved.args @@ -4,6 +4,5 @@ $TEMP_DIR$ -opt-in org.test.Unresolved1 -opt-in -org.test.Unresolved3 --Xexperimental=org.test.Unresolved2 +org.test.Unresolved2 diff --git a/compiler/testData/cli/jvm/experimentalUnresolved.out b/compiler/testData/cli/jvm/experimentalUnresolved.out index 3cf3a857584..a7636802d5d 100644 --- a/compiler/testData/cli/jvm/experimentalUnresolved.out +++ b/compiler/testData/cli/jvm/experimentalUnresolved.out @@ -1,5 +1,3 @@ -warning: '-Xexperimental' is deprecated and will be removed in a future release -warning: opt-in requirement marker org.test.Unresolved2 is unresolved. Please make sure it's present in the module dependencies warning: opt-in requirement marker org.test.Unresolved1 is unresolved. Please make sure it's present in the module dependencies -warning: opt-in requirement marker org.test.Unresolved3 is unresolved. Please make sure it's present in the module dependencies +warning: opt-in requirement marker org.test.Unresolved2 is unresolved. Please make sure it's present in the module dependencies OK diff --git a/compiler/testData/cli/jvm/extraHelp.out b/compiler/testData/cli/jvm/extraHelp.out index 163f5a686a5..547bd67d40d 100644 --- a/compiler/testData/cli/jvm/extraHelp.out +++ b/compiler/testData/cli/jvm/extraHelp.out @@ -160,7 +160,6 @@ where advanced options include: -Xdump-perf= Dump detailed performance statistics to the specified file -Xeffect-system Enable experimental language feature: effect system -Xexpect-actual-linker Enable experimental expect/actual linker - -Xexperimental= Enable and propagate usages of experimental API for marker annotation with the given fully qualified name -Xexplicit-api={strict|warning|disable} Force compiler to report errors on all public API declarations without explicit visibility or return type. Use 'warning' level to issue warnings instead of errors. diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt b/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt deleted file mode 100644 index 11c28e3c3e6..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt +++ /dev/null @@ -1,25 +0,0 @@ -// FIR_IDENTICAL -// !USE_EXPERIMENTAL: kotlin.RequiresOptIn -// !EXPERIMENTAL: api.ExperimentalAPI -// MODULE: api -// FILE: api.kt - -package api - -@RequiresOptIn -@Retention(AnnotationRetention.BINARY) -annotation class ExperimentalAPI - -@ExperimentalAPI -fun function(): String = "" - -// MODULE: usage(api) -// FILE: usage.kt - -package usage - -import api.* - -fun use() { - function() -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.txt b/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.txt deleted file mode 100644 index 875bbdbb51e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.txt +++ /dev/null @@ -1,21 +0,0 @@ -// -- Module: -- -package - -package api { - @api.ExperimentalAPI public fun function(): kotlin.String - - @kotlin.RequiresOptIn @kotlin.annotation.Retention(value = AnnotationRetention.BINARY) public final annotation class ExperimentalAPI : kotlin.Annotation { - public constructor ExperimentalAPI() - public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean - public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int - public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String - } -} - -// -- Module: -- -package - -package usage { - public fun use(): kotlin.Unit -} - diff --git a/compiler/testData/experimental/jsExperimentalModule/lib/lib.kt b/compiler/testData/experimental/jsExperimentalModule/lib/lib.kt deleted file mode 100644 index 25226281099..00000000000 --- a/compiler/testData/experimental/jsExperimentalModule/lib/lib.kt +++ /dev/null @@ -1,8 +0,0 @@ -package lib - -@RequiresOptIn -annotation class ExperimentalAPI - -class Foo - -fun bar() {} diff --git a/compiler/testData/experimental/jsExperimentalModule/output.txt b/compiler/testData/experimental/jsExperimentalModule/output.txt deleted file mode 100644 index 09053fceb69..00000000000 --- a/compiler/testData/experimental/jsExperimentalModule/output.txt +++ /dev/null @@ -1,7 +0,0 @@ -compiler/testData/experimental/jsExperimentalModule/usage.kt:5:15: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI' or '@OptIn(lib.ExperimentalAPI::class)' -fun fail(foo: Foo) { - ^ -compiler/testData/experimental/jsExperimentalModule/usage.kt:6:5: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI' or '@OptIn(lib.ExperimentalAPI::class)' - bar() - ^ -COMPILATION_ERROR diff --git a/compiler/testData/experimental/jsExperimentalModule/usage.kt b/compiler/testData/experimental/jsExperimentalModule/usage.kt deleted file mode 100644 index 3fa639fa740..00000000000 --- a/compiler/testData/experimental/jsExperimentalModule/usage.kt +++ /dev/null @@ -1,12 +0,0 @@ -package usage - -import lib.* - -fun fail(foo: Foo) { - bar() -} - -@ExperimentalAPI -fun ok(foo: Foo) { - bar() -} diff --git a/compiler/testData/experimental/jvmExperimentalModule/lib/lib.kt b/compiler/testData/experimental/jvmExperimentalModule/lib/lib.kt deleted file mode 100644 index 25226281099..00000000000 --- a/compiler/testData/experimental/jvmExperimentalModule/lib/lib.kt +++ /dev/null @@ -1,8 +0,0 @@ -package lib - -@RequiresOptIn -annotation class ExperimentalAPI - -class Foo - -fun bar() {} diff --git a/compiler/testData/experimental/jvmExperimentalModule/output.txt b/compiler/testData/experimental/jvmExperimentalModule/output.txt deleted file mode 100644 index c835c1f29c7..00000000000 --- a/compiler/testData/experimental/jvmExperimentalModule/output.txt +++ /dev/null @@ -1,7 +0,0 @@ -compiler/testData/experimental/jvmExperimentalModule/usage.kt:5:15: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI' or '@OptIn(lib.ExperimentalAPI::class)' -fun fail(foo: Foo) { - ^ -compiler/testData/experimental/jvmExperimentalModule/usage.kt:6:5: error: this declaration is experimental and its usage must be marked with '@lib.ExperimentalAPI' or '@OptIn(lib.ExperimentalAPI::class)' - bar() - ^ -COMPILATION_ERROR diff --git a/compiler/testData/experimental/jvmExperimentalModule/usage.kt b/compiler/testData/experimental/jvmExperimentalModule/usage.kt deleted file mode 100644 index 3fa639fa740..00000000000 --- a/compiler/testData/experimental/jvmExperimentalModule/usage.kt +++ /dev/null @@ -1,12 +0,0 @@ -package usage - -import lib.* - -fun fail(foo: Foo) { - bar() -} - -@ExperimentalAPI -fun ok(foo: Foo) { - bar() -} diff --git a/compiler/testData/moduleProtoBuf/experimental/main.kt b/compiler/testData/moduleProtoBuf/experimental/main.kt deleted file mode 100644 index 80a92563d28..00000000000 --- a/compiler/testData/moduleProtoBuf/experimental/main.kt +++ /dev/null @@ -1,12 +0,0 @@ -package org.foo - -@RequiresOptIn -annotation class A - -class B { - @RequiresOptIn - annotation class C -} - -@RequiresOptIn(level = RequiresOptIn.Level.ERROR) -annotation class D diff --git a/compiler/testData/moduleProtoBuf/experimental/module-proto.txt b/compiler/testData/moduleProtoBuf/experimental/module-proto.txt deleted file mode 100644 index 2a98714105e..00000000000 --- a/compiler/testData/moduleProtoBuf/experimental/module-proto.txt +++ /dev/null @@ -1,2 +0,0 @@ -@org/foo/A -@org/foo/B.C diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index fa7d16ded93..ab56d5f836c 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -34639,12 +34639,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalIsNotEnabled.kt"); } - @Test - @TestMetadata("experimentalOnWholeModule.kt") - public void testExperimentalOnWholeModule() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt"); - } - @Test @TestMetadata("fullFqNameUsage.kt") public void testFullFqNameUsage() throws Exception { diff --git a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/CompilerTestLanguageVersionSettings.kt b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/CompilerTestLanguageVersionSettings.kt index 82aa07c7ad9..351ef3c9d29 100644 --- a/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/CompilerTestLanguageVersionSettings.kt +++ b/compiler/tests-common/tests/org/jetbrains/kotlin/checkers/CompilerTestLanguageVersionSettings.kt @@ -60,7 +60,6 @@ fun parseLanguageVersionSettings(directives: Directives): CompilerTestLanguageVe val languageFeaturesString = directives[LANGUAGE_DIRECTIVE] val analysisFlags = listOfNotNull( - analysisFlag(AnalysisFlags.experimental, directives[EXPERIMENTAL_DIRECTIVE]?.split(' ')), analysisFlag(AnalysisFlags.useExperimental, directives[USE_EXPERIMENTAL_DIRECTIVE]?.split(' ')), analysisFlag(JvmAnalysisFlags.jvmDefaultMode, directives[JVM_DEFAULT_MODE]?.let { JvmDefaultMode.fromStringOrNull(it) }), analysisFlag(AnalysisFlags.ignoreDataFlowInAssert, if (IGNORE_DATA_FLOW_IN_ASSERT_DIRECTIVE in directives) true else null), diff --git a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java index 6c68783c18d..1ff685600d3 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/cli/CliTestGenerated.java @@ -221,11 +221,6 @@ public class CliTestGenerated extends AbstractCliTest { runTest("compiler/testData/cli/jvm/emptySources.args"); } - @TestMetadata("experimentalAndUseExperimentalWithSameAnnotation.args") - public void testExperimentalAndUseExperimentalWithSameAnnotation() throws Exception { - runTest("compiler/testData/cli/jvm/experimentalAndUseExperimentalWithSameAnnotation.args"); - } - @TestMetadata("experimentalDeprecated.args") public void testExperimentalDeprecated() throws Exception { runTest("compiler/testData/cli/jvm/experimentalDeprecated.args"); diff --git a/compiler/tests/org/jetbrains/kotlin/codegen/JvmModuleProtoBufTest.kt b/compiler/tests/org/jetbrains/kotlin/codegen/JvmModuleProtoBufTest.kt index b886bb410d8..3be50f4eb8d 100644 --- a/compiler/tests/org/jetbrains/kotlin/codegen/JvmModuleProtoBufTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/codegen/JvmModuleProtoBufTest.kt @@ -96,15 +96,4 @@ class JvmModuleProtoBufTest : KtUsefulTestCase() { fun testJvmPackageNameMultifileClass() { doTest("/moduleProtoBuf/jvmPackageNameMultifileClass") } - - fun testExperimental() { - doTest( - "/moduleProtoBuf/experimental", extraOptions = listOf( - "-Xopt-in=kotlin.RequiresOptIn", - "-Xexperimental=org.foo.A", - "-Xexperimental=org.foo.B.C", - "-Xopt-in=org.foo.D" - ) - ) - } } diff --git a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/ExperimentalIntegrationTest.kt b/compiler/tests/org/jetbrains/kotlin/jvm/compiler/ExperimentalIntegrationTest.kt deleted file mode 100644 index fc191007800..00000000000 --- a/compiler/tests/org/jetbrains/kotlin/jvm/compiler/ExperimentalIntegrationTest.kt +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2000-2018 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.jvm.compiler - -import org.jetbrains.kotlin.cli.js.K2JSCompiler -import java.io.File - -class ExperimentalIntegrationTest : AbstractKotlinCompilerIntegrationTest() { - override val testDataPath: String - get() = "compiler/testData/experimental/" - - fun testJvmExperimentalModule() { - val lib = compileLibrary( - "lib", additionalOptions = listOf( - "-Xopt-in=kotlin.RequiresOptIn", - "-Xexperimental=lib.ExperimentalAPI" - ), - checkKotlinOutput = { output -> assertTrue(output, output.trimEnd().endsWith("OK")) } - ) - compileKotlin("usage.kt", tmpdir, listOf(lib)) - } - - fun testJsExperimentalModule() { - val lib = compileJsLibrary( - "lib", additionalOptions = listOf( - "-Xopt-in=kotlin.RequiresOptIn", - "-Xexperimental=lib.ExperimentalAPI" - ), - checkKotlinOutput = { output -> assertTrue(output, output.trimEnd().endsWith("OK")) } - ) - compileKotlin("usage.kt", File(tmpdir, "usage.js"), listOf(lib), K2JSCompiler()) - } -} diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index 1c0718a070c..77eeaf25529 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/tests/org/jetbrains/kotlin/idea/fir/low/level/api/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -34543,12 +34543,6 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalIsNotEnabled.kt"); } - @Test - @TestMetadata("experimentalOnWholeModule.kt") - public void testExperimentalOnWholeModule() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt"); - } - @Test @TestMetadata("fullFqNameUsage.kt") public void testFullFqNameUsage() throws Exception { diff --git a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/KotlinJavascriptSerializationUtil.kt b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/KotlinJavascriptSerializationUtil.kt index 186223bc4ab..3104bd4855d 100644 --- a/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/KotlinJavascriptSerializationUtil.kt +++ b/js/js.serializer/src/org/jetbrains/kotlin/serialization/js/KotlinJavascriptSerializationUtil.kt @@ -250,20 +250,6 @@ object KotlinJavascriptSerializationUtil { header.flags = 1 } - val experimentalAnnotationFqNames = languageVersionSettings.getFlag(AnalysisFlags.experimental) - if (experimentalAnnotationFqNames.isNotEmpty()) { - val stringTable = StringTableImpl() - for (fqName in experimentalAnnotationFqNames) { - val descriptor = module.resolveClassByFqName(FqName(fqName), NoLookupLocation.FOR_ALREADY_TRACKED) ?: continue - header.addAnnotation(ProtoBuf.Annotation.newBuilder().apply { - id = stringTable.getFqNameIndex(descriptor) - }) - } - val (strings, qualifiedNames) = stringTable.buildProto() - header.strings = strings - header.qualifiedNames = qualifiedNames - } - // TODO: write JS code binary version return header.build()