expect/actual classes: experimental -> Beta

KT-61573
^KT-61712 Fixed
Review: https://jetbrains.team/p/kt/reviews/12044/files

It's a follow up commit

According our guidelines, it must be in Beta
https://kotlinlang.org/docs/components-stability.html#stability-of-subcomponents

And the whole multiplatform was in Beta, so we can't make part of the
multiplatform to have lower stability level
This commit is contained in:
Nikita Bobko
2023-09-05 12:08:35 +02:00
committed by Space Team
parent 0cd91d9286
commit 2127b2ce68
58 changed files with 259 additions and 257 deletions
@@ -866,7 +866,7 @@ public interface Errors {
ACTUAL_CLASSIFIER_MUST_HAVE_THE_SAME_SUPERTYPES_AS_NON_FINAL_EXPECT_CLASSIFIER =
DiagnosticFactory3.create(ERROR, DECLARATION_NAME);
DiagnosticFactory0<KtClassLikeDeclaration> EXPECT_ACTUAL_CLASSIFIERS_ARE_EXPERIMENTAL_WARNING = DiagnosticFactory0.create(WARNING, EXPECT_ACTUAL_MODIFIER);
DiagnosticFactory0<KtClassLikeDeclaration> EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING = DiagnosticFactory0.create(WARNING, EXPECT_ACTUAL_MODIFIER);
DiagnosticFactory0<PsiElement> OPTIONAL_EXPECTATION_NOT_ON_EXPECTED = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<PsiElement> OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY = DiagnosticFactory0.create(ERROR);
@@ -430,9 +430,10 @@ public class DefaultErrorMessages {
new ListRenderer<>(TO_STRING, (elem) -> "'" + elem + "'"),
NAME);
MAP.put(EXPECT_ACTUAL_CLASSIFIERS_ARE_EXPERIMENTAL_WARNING,
"The expect/actual classes (including interfaces, objects, annotations, enums, actual typealiases) are an experimental feature. " +
"You can use -Xexpect-actual-classes flag to suppress this warning.");
MAP.put(EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING,
"'expect'/'actual' classes (including interfaces, objects, annotations, enums, and 'actual' typealiases) are in Beta. " +
"You can use -Xexpect-actual-classes flag to suppress this warning. " +
"Also see: https://youtrack.jetbrains.com/issue/KT-61573");
MAP.put(OPTIONAL_EXPECTATION_NOT_ON_EXPECTED, "'@OptionalExpectation' can only be used on an expected annotation class");
MAP.put(OPTIONAL_DECLARATION_OUTSIDE_OF_ANNOTATION_ENTRY, "Declaration annotated with '@OptionalExpectation' can only be used inside an annotation entry");
@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.types.DynamicTypesSettings
private val DEFAULT_DECLARATION_CHECKERS = listOf(
ExpectActualInTheSameModuleChecker,
ActualClassifierMustHasTheSameMembersAsNonFinalExpectClassifierChecker,
ExpectActualClassifiersAreExperimentalChecker,
ExpectActualClassifiersAreInBetaChecker,
DataClassDeclarationChecker(),
ConstModifierChecker,
UnderscoreChecker,
@@ -17,7 +17,7 @@ import org.jetbrains.kotlin.psi.KtClassOrObject
import org.jetbrains.kotlin.psi.KtDeclaration
import org.jetbrains.kotlin.psi.KtTypeAlias
object ExpectActualClassifiersAreExperimentalChecker : DeclarationChecker {
object ExpectActualClassifiersAreInBetaChecker : DeclarationChecker {
override fun check(declaration: KtDeclaration, descriptor: DeclarationDescriptor, context: DeclarationCheckerContext) {
if (!context.languageVersionSettings.supportsFeature(LanguageFeature.MultiPlatformProjects)) return
if (context.languageVersionSettings.getFlag(AnalysisFlags.muteExpectActualClassesWarning)) return
@@ -31,7 +31,7 @@ object ExpectActualClassifiersAreExperimentalChecker : DeclarationChecker {
check(descriptor is ClassifierDescriptorWithTypeParameters)
if (descriptor.isExpect || descriptor.isActual) {
context.trace.report(Errors.EXPECT_ACTUAL_CLASSIFIERS_ARE_EXPERIMENTAL_WARNING.on(declaration))
context.trace.report(Errors.EXPECT_ACTUAL_CLASSIFIERS_ARE_IN_BETA_WARNING.on(declaration))
}
}
}