diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt index 8e5d0503ecf..8a396c1c0ef 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt @@ -171,6 +171,7 @@ public class AnnotationChecker(private val additionalCheckers: Iterable if (annotated.projectionKind == JetProjectionKind.STAR) TargetLists.T_STAR_PROJECTION else TargetLists.T_TYPE_PROJECTION is JetClassInitializer -> TargetLists.T_INITIALIZER + is JetMultiDeclaration -> TargetLists.T_MULTI_DECLARATION else -> TargetLists.EMPTY } } @@ -182,6 +183,8 @@ public class AnnotationChecker(private val additionalCheckers: Iterable@Ann val (a, b) = Pair(12, 34) + @Err val (c, d) = Pair(56, 78) + return a + b + c + d +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/annotations/MultiDeclaration.txt b/compiler/testData/diagnostics/tests/annotations/MultiDeclaration.txt new file mode 100644 index 00000000000..24773a99689 --- /dev/null +++ b/compiler/testData/diagnostics/tests/annotations/MultiDeclaration.txt @@ -0,0 +1,22 @@ +package + +public fun foo(): kotlin.Int + +@kotlin.annotation.annotation() public final class Ann : kotlin.Annotation { + public constructor Ann() + 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 +} + +@kotlin.data() public final class Pair { + public constructor Pair(/*0*/ x: kotlin.Int, /*1*/ y: kotlin.Int) + public final val x: kotlin.Int + public final val y: kotlin.Int + public final /*synthesized*/ fun component1(): kotlin.Int + public final /*synthesized*/ fun component2(): kotlin.Int + public final /*synthesized*/ fun copy(/*0*/ x: kotlin.Int = ..., /*1*/ y: kotlin.Int = ...): Pair + 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 +} diff --git a/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.kt b/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.kt index bb03f70eb0d..f1e81ebfe95 100644 --- a/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.kt +++ b/compiler/testData/diagnostics/tests/annotations/forParameterAnnotationResolve.kt @@ -10,5 +10,5 @@ fun foo() { for (@Ann(3) (x, @Ann(4) y) in bar()) {} - for (@Err (x,y) in bar()) {} + for (@Err (x,y) in bar()) {} } \ No newline at end of file diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java index 0f682e2f647..f859dc0cd82 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestGenerated.java @@ -813,6 +813,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest { doTest(fileName); } + @TestMetadata("MultiDeclaration.kt") + public void testMultiDeclaration() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/annotations/MultiDeclaration.kt"); + doTest(fileName); + } + @TestMetadata("MutuallyRecursivelyAnnotatedGlobalFunction.kt") public void testMutuallyRecursivelyAnnotatedGlobalFunction() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/annotations/MutuallyRecursivelyAnnotatedGlobalFunction.kt"); diff --git a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/KotlinTarget.kt b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/KotlinTarget.kt index 9f62c5a2ba6..cab41a1465f 100644 --- a/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/KotlinTarget.kt +++ b/core/descriptors/src/org/jetbrains/kotlin/descriptors/annotations/KotlinTarget.kt @@ -59,7 +59,8 @@ public enum class KotlinTarget(val description: String, val isDefault: Boolean = MEMBER_PROPERTY("member property", false), // includes PROPERTY_PARAMETER TOP_LEVEL_PROPERTY("top level property", false), - INITIALIZER("initializer", false) + INITIALIZER("initializer", false), + MULTI_DECLARATION("multi declaration", false) ; companion object {