From 98867972abf7707bb2599dd1f0c87f410a28b83d Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Thu, 29 Jun 2017 21:12:26 +0300 Subject: [PATCH 1/2] Improve diagnostic message for annotations with @receiver #KT-14647 Fixed GitOrigin-RevId: 15428709df6c679751318ea3d7740a6e6f1bd6dc --- .../testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt | 2 +- .../testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/kotlin/idea/tests/testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt b/plugins/kotlin/idea/tests/testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt index 0fee8dbf7ad9..70b72279c1eb 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt @@ -1,5 +1,5 @@ // "Move annotation to receiver type" "false" -// ERROR: '@receiver:' annotations could be applied only to extension function or extension property declarations +// ERROR: '@receiver:' annotations can only be applied to the receiver type of extension function or extension property declarations // ACTION: Convert to expression body // ACTION: Make internal // ACTION: Make private diff --git a/plugins/kotlin/idea/tests/testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt b/plugins/kotlin/idea/tests/testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt index 2143b19947b7..a5acb4bc298c 100644 --- a/plugins/kotlin/idea/tests/testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt +++ b/plugins/kotlin/idea/tests/testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt @@ -1,5 +1,5 @@ // "Move annotation to receiver type" "false" -// ERROR: '@receiver:' annotations could be applied only to extension function or extension property declarations +// ERROR: '@receiver:' annotations can only be applied to the receiver type of extension function or extension property declarations // ACTION: Make internal // ACTION: Make private // ACTION: Specify type explicitly From 9c59b1dbe9e6545fcd84be6b5e3062ed2d178d9c Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Fri, 30 Jun 2017 17:33:52 +0300 Subject: [PATCH 2/2] Add test for obsolete issue #KT-6502 Obsolete GitOrigin-RevId: fce1fd1e65a77566802ebc0b12f8d10ec439dc72 --- .../jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java | 6 ++++++ .../instantiationOfInnerClassInQualifiedForm.kt | 7 +++++++ 2 files changed, 13 insertions(+) create mode 100644 plugins/kotlin/idea/tests/testData/checker/diagnosticsMessage/instantiationOfInnerClassInQualifiedForm.kt diff --git a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java index ca1b86f5dce0..ae41edef17ab 100644 --- a/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java +++ b/plugins/kotlin/idea/tests/test/org/jetbrains/kotlin/checkers/PsiCheckerTestGenerated.java @@ -992,6 +992,12 @@ public class PsiCheckerTestGenerated extends AbstractPsiCheckerTest { doTest(fileName); } + @TestMetadata("instantiationOfInnerClassInQualifiedForm.kt") + public void testInstantiationOfInnerClassInQualifiedForm() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/diagnosticsMessage/instantiationOfInnerClassInQualifiedForm.kt"); + doTest(fileName); + } + @TestMetadata("noSubstitutedTypeParameter.kt") public void testNoSubstitutedTypeParameter() throws Exception { String fileName = KotlinTestUtils.navigationMetadata("idea/testData/checker/diagnosticsMessage/noSubstitutedTypeParameter.kt"); diff --git a/plugins/kotlin/idea/tests/testData/checker/diagnosticsMessage/instantiationOfInnerClassInQualifiedForm.kt b/plugins/kotlin/idea/tests/testData/checker/diagnosticsMessage/instantiationOfInnerClassInQualifiedForm.kt new file mode 100644 index 000000000000..669df69ed67b --- /dev/null +++ b/plugins/kotlin/idea/tests/testData/checker/diagnosticsMessage/instantiationOfInnerClassInQualifiedForm.kt @@ -0,0 +1,7 @@ +class A { + inner class XYZ + + fun foo() { + val v: A.XYZ = A.XYZ() + } +} \ No newline at end of file