From c853ac95ad20875c0f49fc45910077cc5492c13a Mon Sep 17 00:00:00 2001 From: Mikhail Zarechenskiy Date: Thu, 29 Jun 2017 21:12:26 +0300 Subject: [PATCH] Improve diagnostic message for annotations with @receiver #KT-14647 Fixed --- .../kotlin/diagnostics/rendering/DefaultErrorMessages.java | 2 +- .../testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt | 2 +- .../testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 d745858b040..fb0b0a49128 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -156,7 +156,7 @@ public class DefaultErrorMessages { MAP.put(INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE, "''@{0}:'' annotations could be applied only to mutable properties", TO_STRING); MAP.put(INAPPLICABLE_TARGET_PROPERTY_HAS_NO_DELEGATE, "'@delegate:' annotations could be applied only to delegated properties"); MAP.put(INAPPLICABLE_TARGET_PROPERTY_HAS_NO_BACKING_FIELD, "'@field:' annotations could be applied only to properties with backing fields"); - MAP.put(INAPPLICABLE_RECEIVER_TARGET, "'@receiver:' annotations could be applied only to extension function or extension property declarations"); + MAP.put(INAPPLICABLE_RECEIVER_TARGET, "'@receiver:' annotations can only be applied to the receiver type of extension function or extension property declarations"); MAP.put(INAPPLICABLE_PARAM_TARGET, "'@param:' annotations could be applied only to primary constructor parameters"); MAP.put(REDUNDANT_ANNOTATION_TARGET, "Redundant annotation target ''{0}''", STRING); diff --git a/idea/testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt b/idea/testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt index 0fee8dbf7ad..70b72279c1e 100644 --- a/idea/testData/quickfix/moveReceiverAnnotation/notExtensionFun.kt +++ b/idea/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/idea/testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt b/idea/testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt index 2143b19947b..a5acb4bc298 100644 --- a/idea/testData/quickfix/moveReceiverAnnotation/notExtensionVal.kt +++ b/idea/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