diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index 79330dc384f..472ccc5a628 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -1127,6 +1127,18 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag runTest("compiler/testData/diagnostics/tests/annotations/annotationsOnNullableTypes.kt"); } + @Test + @TestMetadata("arrayLiteralInAnnotationCompanion_after.kt") + public void testArrayLiteralInAnnotationCompanion_after() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.kt"); + } + + @Test + @TestMetadata("arrayLiteralInAnnotationCompanion_before.kt") + public void testArrayLiteralInAnnotationCompanion_before() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.kt"); + } + @Test @TestMetadata("atAnnotationResolve.kt") public void testAtAnnotationResolve() throws Exception { 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 e4c99e61e41..0d761c4f83f 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 @@ -1127,6 +1127,18 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/tests/annotations/annotationsOnNullableTypes.kt"); } + @Test + @TestMetadata("arrayLiteralInAnnotationCompanion_after.kt") + public void testArrayLiteralInAnnotationCompanion_after() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.kt"); + } + + @Test + @TestMetadata("arrayLiteralInAnnotationCompanion_before.kt") + public void testArrayLiteralInAnnotationCompanion_before() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.kt"); + } + @Test @TestMetadata("atAnnotationResolve.kt") public void testAtAnnotationResolve() 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 00c4b6d37e3..50de4b2d70d 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 @@ -1127,6 +1127,18 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac runTest("compiler/testData/diagnostics/tests/annotations/annotationsOnNullableTypes.kt"); } + @Test + @TestMetadata("arrayLiteralInAnnotationCompanion_after.kt") + public void testArrayLiteralInAnnotationCompanion_after() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.kt"); + } + + @Test + @TestMetadata("arrayLiteralInAnnotationCompanion_before.kt") + public void testArrayLiteralInAnnotationCompanion_before() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.kt"); + } + @Test @TestMetadata("atAnnotationResolve.kt") public void testAtAnnotationResolve() throws Exception { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index cf516962bff..042a0f3ab3d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -60,6 +60,7 @@ public interface Errors { //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// DiagnosticFactory1 UNSUPPORTED = DiagnosticFactory1.create(ERROR); + DiagnosticFactory1 UNSUPPORTED_WARNING = DiagnosticFactory1.create(WARNING); DiagnosticFactory1 NEW_INFERENCE_ERROR = DiagnosticFactory1.create(ERROR); DiagnosticFactory1 NEW_INFERENCE_DIAGNOSTIC = DiagnosticFactory1.create(WARNING); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java index bd4584187e6..c905fcc99d3 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -716,6 +716,7 @@ public class DefaultErrorMessages { MAP.put(UNSAFE_IMPLICIT_INVOKE_CALL, "Reference has a nullable type ''{0}'', use explicit ''?.invoke()'' to make a function-like call instead", RENDER_TYPE); MAP.put(AMBIGUOUS_LABEL, "Ambiguous label"); MAP.put(UNSUPPORTED, "Unsupported [{0}]", STRING); + MAP.put(UNSUPPORTED_WARNING, "Unsupported [{0}]. This warning will be an error in future releases", STRING); MAP.put(NEW_INFERENCE_ERROR, "New inference error [{0}]", STRING); MAP.put(NEW_INFERENCE_DIAGNOSTIC, "New inference [{0}]", STRING); MAP.put(NON_APPLICABLE_CALL_FOR_BUILDER_INFERENCE, "Non-applicable call for builder inference"); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/CollectionLiteralResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/CollectionLiteralResolver.kt index 7abce7196f3..650246692f3 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/CollectionLiteralResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/CollectionLiteralResolver.kt @@ -5,21 +5,25 @@ package org.jetbrains.kotlin.resolve +import com.intellij.psi.PsiElement import com.intellij.psi.util.PsiTreeUtil import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.builtins.StandardNames import org.jetbrains.kotlin.builtins.UnsignedTypes -import org.jetbrains.kotlin.config.LanguageFeature +import org.jetbrains.kotlin.config.LanguageFeature.* import org.jetbrains.kotlin.config.LanguageVersionSettings import org.jetbrains.kotlin.descriptors.ModuleDescriptor import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor +import org.jetbrains.kotlin.diagnostics.DiagnosticFactory1 import org.jetbrains.kotlin.diagnostics.Errors.* import org.jetbrains.kotlin.incremental.KotlinLookupLocation import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.KtAnnotationEntry import org.jetbrains.kotlin.psi.KtClass import org.jetbrains.kotlin.psi.KtCollectionLiteralExpression +import org.jetbrains.kotlin.psi.KtObjectDeclaration import org.jetbrains.kotlin.resolve.BindingContext.COLLECTION_LITERAL_CALL +import org.jetbrains.kotlin.resolve.CollectionLiteralResolver.ContainerKind.* import org.jetbrains.kotlin.resolve.calls.CallResolver import org.jetbrains.kotlin.resolve.calls.util.CallMaker import org.jetbrains.kotlin.types.KotlinType @@ -38,13 +42,29 @@ class CollectionLiteralResolver( collectionLiteralExpression: KtCollectionLiteralExpression, context: ExpressionTypingContext ): KotlinTypeInfo { - if (!isInsideAnnotationEntryOrClass(collectionLiteralExpression)) { - context.trace.report(UNSUPPORTED.on(collectionLiteralExpression, "Collection literals outside of annotations")) + when (computeKindOfContainer(collectionLiteralExpression)) { + AnnotationOrAnnotationClass -> {} + CompanionOfAnnotation -> { + val factory = when (context.languageVersionSettings.supportsFeature(ProhibitArrayLiteralsInCompanionOfAnnotation)) { + true -> UNSUPPORTED + false -> UNSUPPORTED_WARNING + } + reportUnsupportedLiteral(context, factory, collectionLiteralExpression) + } + Other -> reportUnsupportedLiteral(context, UNSUPPORTED, collectionLiteralExpression) } return resolveCollectionLiteralSpecialMethod(collectionLiteralExpression, context) } + private fun reportUnsupportedLiteral( + context: ExpressionTypingContext, + diagnosticFactory: DiagnosticFactory1, + collectionLiteralExpression: KtCollectionLiteralExpression + ) { + context.trace.report(diagnosticFactory.on(collectionLiteralExpression, "Collection literals outside of annotations")) + } + private fun resolveCollectionLiteralSpecialMethod( expression: KtCollectionLiteralExpression, context: ExpressionTypingContext @@ -79,9 +99,25 @@ class CollectionLiteralResolver( return memberScopeOfKotlinPackage.getContributedFunctions(callName, KotlinLookupLocation(expression)) } - private fun isInsideAnnotationEntryOrClass(expression: KtCollectionLiteralExpression): Boolean { - val parent = PsiTreeUtil.getParentOfType(expression, KtAnnotationEntry::class.java, KtClass::class.java) - return parent is KtAnnotationEntry || (parent is KtClass && parent.isAnnotation()) + private enum class ContainerKind { + AnnotationOrAnnotationClass, + CompanionOfAnnotation, + Other + } + + private fun computeKindOfContainer(expression: KtCollectionLiteralExpression): ContainerKind { + val parent = PsiTreeUtil.getParentOfType(expression, KtAnnotationEntry::class.java, KtClass::class.java, KtObjectDeclaration::class.java) + if (parent is KtObjectDeclaration) { + val containingAnnotation = PsiTreeUtil.getParentOfType(parent, KtClass::class.java) + if (containingAnnotation != null && containingAnnotation.isAnnotation()) { + return CompanionOfAnnotation + } + } + return if (parent is KtAnnotationEntry || (parent is KtClass && parent.isAnnotation())) { + AnnotationOrAnnotationClass + } else { + Other + } } private fun getArrayFunctionCallName(expectedType: KotlinType): Name { diff --git a/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.fir.kt b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.fir.kt new file mode 100644 index 00000000000..12e6783c531 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.fir.kt @@ -0,0 +1,48 @@ +// LANGUAGE: +ProhibitArrayLiteralsInCompanionOfAnnotation +// ISSUE: KT-39041 + +annotation class Ann(val x: IntArray = [1, 2, 3]) { // OK + companion object { + val y1: IntArray = [1, 2, 3] // Error + + val z1: IntArray + get() = [1, 2, 3] // Error + + fun test_1(): IntArray { + return [1, 2, 3] // Error + } + + class Nested { + val y2: IntArray = [1, 2, 3] // Error + + val z2: IntArray + get() = [1, 2, 3] // Error + + fun test_2(): IntArray { + return [1, 2, 3] // Error + } + } + } + + object Foo { + val y3: IntArray = [1, 2, 3] // Error + + val z3: IntArray + get() = [1, 2, 3] // Error + + fun test_3(): IntArray { + return [1, 2, 3] // Error + } + } + + class Nested { + val y4: IntArray = [1, 2, 3] // Error + + val z4: IntArray + get() = [1, 2, 3] // Error + + fun test_4(): IntArray { + return [1, 2, 3] // Error + } + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.kt b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.kt new file mode 100644 index 00000000000..37859a12253 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.kt @@ -0,0 +1,48 @@ +// LANGUAGE: +ProhibitArrayLiteralsInCompanionOfAnnotation +// ISSUE: KT-39041 + +annotation class Ann(val x: IntArray = [1, 2, 3]) { // OK + companion object { + val y1: IntArray = [1, 2, 3] // Error + + val z1: IntArray + get() = [1, 2, 3] // Error + + fun test_1(): IntArray { + return [1, 2, 3] // Error + } + + class Nested { + val y2: IntArray = [1, 2, 3] // Error + + val z2: IntArray + get() = [1, 2, 3] // Error + + fun test_2(): IntArray { + return [1, 2, 3] // Error + } + } + } + + object Foo { + val y3: IntArray = [1, 2, 3] // Error + + val z3: IntArray + get() = [1, 2, 3] // Error + + fun test_3(): IntArray { + return [1, 2, 3] // Error + } + } + + class Nested { + val y4: IntArray = [1, 2, 3] // Error + + val z4: IntArray + get() = [1, 2, 3] // Error + + fun test_4(): IntArray { + return [1, 2, 3] // Error + } + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.txt b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.txt new file mode 100644 index 00000000000..8ca0314b11e --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.txt @@ -0,0 +1,49 @@ +package + +public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ x: kotlin.IntArray = ...) + public final val x: kotlin.IntArray + 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 + + public companion object Companion { + private constructor Companion() + public final val y1: kotlin.IntArray + public final val z1: kotlin.IntArray + 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 final fun test_1(): kotlin.IntArray + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final class Nested { + public constructor Nested() + public final val y2: kotlin.IntArray + public final val z2: kotlin.IntArray + 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 final fun test_2(): kotlin.IntArray + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } + + public object Foo { + private constructor Foo() + public final val y3: kotlin.IntArray + public final val z3: kotlin.IntArray + 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 final fun test_3(): kotlin.IntArray + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public final class Nested { + public constructor Nested() + public final val y4: kotlin.IntArray + public final val z4: kotlin.IntArray + 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 final fun test_4(): kotlin.IntArray + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.fir.kt b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.fir.kt new file mode 100644 index 00000000000..675a9b25d30 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.fir.kt @@ -0,0 +1,48 @@ +// LANGUAGE: -ProhibitArrayLiteralsInCompanionOfAnnotation +// ISSUE: KT-39041 + +annotation class Ann(val x: IntArray = [1, 2, 3]) { // OK + companion object { + val y1: IntArray = [1, 2, 3] // Error + + val z1: IntArray + get() = [1, 2, 3] // Error + + fun test_1(): IntArray { + return [1, 2, 3] // Error + } + + class Nested { + val y2: IntArray = [1, 2, 3] // Error + + val z2: IntArray + get() = [1, 2, 3] // Error + + fun test_2(): IntArray { + return [1, 2, 3] // Error + } + } + } + + object Foo { + val y3: IntArray = [1, 2, 3] // Error + + val z3: IntArray + get() = [1, 2, 3] // Error + + fun test_3(): IntArray { + return [1, 2, 3] // Error + } + } + + class Nested { + val y4: IntArray = [1, 2, 3] // Error + + val z4: IntArray + get() = [1, 2, 3] // Error + + fun test_4(): IntArray { + return [1, 2, 3] // Error + } + } +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.kt b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.kt new file mode 100644 index 00000000000..a46ddc2a3dc --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.kt @@ -0,0 +1,48 @@ +// LANGUAGE: -ProhibitArrayLiteralsInCompanionOfAnnotation +// ISSUE: KT-39041 + +annotation class Ann(val x: IntArray = [1, 2, 3]) { // OK + companion object { + val y1: IntArray = [1, 2, 3] // Error + + val z1: IntArray + get() = [1, 2, 3] // Error + + fun test_1(): IntArray { + return [1, 2, 3] // Error + } + + class Nested { + val y2: IntArray = [1, 2, 3] // Error + + val z2: IntArray + get() = [1, 2, 3] // Error + + fun test_2(): IntArray { + return [1, 2, 3] // Error + } + } + } + + object Foo { + val y3: IntArray = [1, 2, 3] // Error + + val z3: IntArray + get() = [1, 2, 3] // Error + + fun test_3(): IntArray { + return [1, 2, 3] // Error + } + } + + class Nested { + val y4: IntArray = [1, 2, 3] // Error + + val z4: IntArray + get() = [1, 2, 3] // Error + + fun test_4(): IntArray { + return [1, 2, 3] // Error + } + } +} diff --git a/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.txt b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.txt new file mode 100644 index 00000000000..befd9f203fa --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.txt @@ -0,0 +1,50 @@ +package + +public final annotation class Ann : kotlin.Annotation { + public constructor Ann(/*0*/ x: kotlin.IntArray = ...) + public final val x: kotlin.IntArray + 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 + + public companion object Companion { + private constructor Companion() + public final val y1: kotlin.IntArray + public final val z1: kotlin.IntArray + 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 final fun test_1(): kotlin.IntArray + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + + public final class Nested { + public constructor Nested() + public final val y2: kotlin.IntArray + public final val z2: kotlin.IntArray + 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 final fun test_2(): kotlin.IntArray + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + } + + public object Foo { + private constructor Foo() + public final val y3: kotlin.IntArray + public final val z3: kotlin.IntArray + 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 final fun test_3(): kotlin.IntArray + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } + + public final class Nested { + public constructor Nested() + public final val y4: kotlin.IntArray + public final val z4: kotlin.IntArray + 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 final fun test_4(): kotlin.IntArray + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + } +} + 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 dc80378ab2c..6e34a8278e4 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 @@ -1127,6 +1127,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/tests/annotations/annotationsOnNullableTypes.kt"); } + @Test + @TestMetadata("arrayLiteralInAnnotationCompanion_after.kt") + public void testArrayLiteralInAnnotationCompanion_after() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_after.kt"); + } + + @Test + @TestMetadata("arrayLiteralInAnnotationCompanion_before.kt") + public void testArrayLiteralInAnnotationCompanion_before() throws Exception { + runTest("compiler/testData/diagnostics/tests/annotations/arrayLiteralInAnnotationCompanion_before.kt"); + } + @Test @TestMetadata("atAnnotationResolve.kt") public void testAtAnnotationResolve() throws Exception { diff --git a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt index 164c8cb47b5..1983c476493 100644 --- a/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt +++ b/compiler/util/src/org/jetbrains/kotlin/config/LanguageVersionSettings.kt @@ -258,6 +258,7 @@ enum class LanguageFeature( DisableCheckingChangedProgressionsResolve(KOTLIN_1_9), // KT-49276 ProhibitIllegalValueParameterUsageInDefaultArguments(KOTLIN_1_9, kind = BUG_FIX), // KT-25694 ProhibitConstructorCallOnFunctionalSupertype(KOTLIN_1_9, kind = BUG_FIX), // KT-46344 + ProhibitArrayLiteralsInCompanionOfAnnotation(KOTLIN_1_9, kind = BUG_FIX), // KT-39041 // Temporarily disabled, see KT-27084/KT-22379 SoundSmartcastFromLoopConditionForLoopAssignedVariables(sinceVersion = null, kind = BUG_FIX),