Cover KT-60646 with regression tests
This behavior wasn't intended during KT-15470 coding. I only intended to prohibit `@get:` target on things different from properties. But I accidentally prohibited `@property` on things different from properties too But it's a bug fix anyway, so let's keep it. I also re-checked the implementation of KT-15470, I don't see any other unintentional prohibitions
This commit is contained in:
+12
@@ -2937,6 +2937,18 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_error.kt")
|
||||
public void testPropertyTargetOnEnumEntry_error() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_error.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_warning.kt")
|
||||
public void testPropertyTargetOnEnumEntry_warning() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_warning.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ReceiverAnnotations.kt")
|
||||
public void testReceiverAnnotations() throws Exception {
|
||||
|
||||
+12
@@ -2937,6 +2937,18 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_error.kt")
|
||||
public void testPropertyTargetOnEnumEntry_error() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_error.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_warning.kt")
|
||||
public void testPropertyTargetOnEnumEntry_warning() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_warning.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ReceiverAnnotations.kt")
|
||||
public void testReceiverAnnotations() throws Exception {
|
||||
|
||||
+12
@@ -2937,6 +2937,18 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_error.kt")
|
||||
public void testPropertyTargetOnEnumEntry_error() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_error.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_warning.kt")
|
||||
public void testPropertyTargetOnEnumEntry_warning() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_warning.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ReceiverAnnotations.kt")
|
||||
public void testReceiverAnnotations() throws Exception {
|
||||
|
||||
+12
@@ -2943,6 +2943,18 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_error.kt")
|
||||
public void testPropertyTargetOnEnumEntry_error() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_error.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_warning.kt")
|
||||
public void testPropertyTargetOnEnumEntry_warning() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_warning.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ReceiverAnnotations.kt")
|
||||
public void testReceiverAnnotations() throws Exception {
|
||||
|
||||
compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_error.kt
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: +ProhibitUseSiteGetTargetAnnotations
|
||||
|
||||
@Target(AnnotationTarget.PROPERTY) annotation class Annotation
|
||||
|
||||
enum class Foo {
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY!>@property:Annotation<!>
|
||||
Entry
|
||||
}
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FIR_IDENTICAL
|
||||
// !LANGUAGE: -ProhibitUseSiteGetTargetAnnotations
|
||||
|
||||
@Target(AnnotationTarget.PROPERTY) annotation class Annotation
|
||||
|
||||
enum class Foo {
|
||||
<!INAPPLICABLE_TARGET_ON_PROPERTY_WARNING!>@property:Annotation<!>
|
||||
Entry
|
||||
}
|
||||
Generated
+12
@@ -2943,6 +2943,18 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/PropertyAnnotations.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_error.kt")
|
||||
public void testPropertyTargetOnEnumEntry_error() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_error.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("propertyTargetOnEnumEntry_warning.kt")
|
||||
public void testPropertyTargetOnEnumEntry_warning() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/annotations/withUseSiteTarget/propertyTargetOnEnumEntry_warning.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("ReceiverAnnotations.kt")
|
||||
public void testReceiverAnnotations() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user