From 8316953259669822fc27400c4ac7733490128635 Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Tue, 29 Mar 2016 14:13:59 +0300 Subject: [PATCH] Fix double quotes in diagnostic messages For diagnostics without any parameters, the given text is simply rendered as a String, so no symbols should be escaped. For diagnostics with parameters, the format in java.text.MessageFormat is used, so one single quote is erased and two single quotes become one single quote in the rendered text. --- .../diagnostics/DefaultErrorMessagesJvm.java | 26 ++++----- .../rendering/DefaultErrorMessages.java | 54 +++++++++---------- .../checker/JvmStaticUsagesRuntime.kt | 12 ++--- idea/testData/checker/SafeInvoke.kt | 6 +-- idea/testData/checker/WhenNonExhaustive.kt | 22 ++++---- idea/testData/checker/infos/SmartCasts.kt | 2 +- .../imports/JavaStaticViaClass.expected.kt | 2 +- .../conditionNotBinaryExpr.kt | 2 +- .../ifThenToElvis/conditionNotBinaryExpr.kt | 2 +- .../missingDefaultArgument.kt | 2 +- .../multipleArguments.kt | 2 +- .../unacceptableVararg1.kt | 2 +- .../unacceptableVararg2.kt | 2 +- .../functionLiteralArgument.kt | 2 +- .../namedValueArgument.kt | 2 +- .../unacceptableVararg.kt | 2 +- .../valueArgument.kt | 2 +- .../replaceContains/invalidArgument.kt | 2 +- .../replaceContains/missingArgument.kt | 2 +- .../replaceContains/missingDefaultArgument.kt | 2 +- .../replaceContains/multipleArguments.kt | 2 +- .../replaceContains/unacceptableVararg1.kt | 2 +- .../replaceContains/unacceptableVararg2.kt | 2 +- .../replaceGetOrSet/noArgument.kt | 2 +- .../replaceGetOrSet/setWithNoParameters.kt | 2 +- .../replaceGetOrSet/setWithVararg.kt | 2 +- .../replaceGetOrSet/topLevelFun.kt | 2 +- .../intentions/swapBinaryExpression/is.kt | 2 +- ...ExtensionImportGetOnNoOperatorWarning.test | 4 +- ...ExtensionImportSetOnNoOperatorWarning.test | 4 +- .../quickfix/autoImports/invokeExtension.test | 6 +-- .../invokeExtensionNoOperator.test | 6 +-- ...llableWithExclExclAbsentWithBadIterator.kt | 2 +- .../modifiers/operatorModifierComponent.kt | 2 +- .../operatorModifierComponent.kt.after | 2 +- ...rivateTopLevelVarWithSetterInFile.after.kt | 2 +- ...TopLevelVarWithSetterInFile.before.Main.kt | 2 +- .../propertyCallWithArguments.kt | 2 +- .../enumEntryAdded/build.log | 2 +- .../sealedClassImplAdded/build.log | 2 +- .../diagnostics/DefaultErrorMessagesJs.kt | 4 +- 41 files changed, 103 insertions(+), 103 deletions(-) diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/DefaultErrorMessagesJvm.java b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/DefaultErrorMessagesJvm.java index 03729a88944..8286222f222 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/DefaultErrorMessagesJvm.java +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/diagnostics/DefaultErrorMessagesJvm.java @@ -49,7 +49,7 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension { } }; - public static final DiagnosticFactoryToRendererMap MAP = new DiagnosticFactoryToRendererMap("JVM"); + private static final DiagnosticFactoryToRendererMap MAP = new DiagnosticFactoryToRendererMap("JVM"); static { MAP.put(ErrorsJvm.CONFLICTING_JVM_DECLARATIONS, "Platform declaration clash: {0}", CONFLICTING_JVM_DECLARATIONS_DATA); MAP.put(ErrorsJvm.ACCIDENTAL_OVERRIDE, "Accidental override: {0}", CONFLICTING_JVM_DECLARATIONS_DATA); @@ -57,17 +57,17 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension { MAP.put(ErrorsJvm.MISSING_DEPENDENCY_CLASS, "Cannot access class ''{0}''. Check your module classpath for missing or conflicting dependencies", Renderers.TO_STRING); - MAP.put(ErrorsJvm.JVM_STATIC_NOT_IN_OBJECT, "Only functions in named objects and companion objects of classes can be annotated with ''@JvmStatic''"); - MAP.put(ErrorsJvm.JVM_STATIC_ON_CONST_OR_JVM_FIELD, "''@JvmStatic'' annotation is useless for const or ''@JvmField'' properties"); - MAP.put(ErrorsJvm.OVERRIDE_CANNOT_BE_STATIC, "Override member cannot be ''@JvmStatic'' in object"); - MAP.put(ErrorsJvm.OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS, "''@JvmOverloads'' annotation has no effect for methods without default arguments"); - MAP.put(ErrorsJvm.OVERLOADS_ABSTRACT, "''@JvmOverloads'' annotation cannot be used on abstract methods"); - MAP.put(ErrorsJvm.OVERLOADS_PRIVATE, "''@JvmOverloads'' annotation has no effect on private and local declarations"); - MAP.put(ErrorsJvm.INAPPLICABLE_JVM_NAME, "''@JvmName'' annotation is not applicable to this declaration"); + MAP.put(ErrorsJvm.JVM_STATIC_NOT_IN_OBJECT, "Only functions in named objects and companion objects of classes can be annotated with '@JvmStatic'"); + MAP.put(ErrorsJvm.JVM_STATIC_ON_CONST_OR_JVM_FIELD, "'@JvmStatic' annotation is useless for const or '@JvmField' properties"); + MAP.put(ErrorsJvm.OVERRIDE_CANNOT_BE_STATIC, "Override member cannot be '@JvmStatic' in object"); + MAP.put(ErrorsJvm.OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS, "'@JvmOverloads' annotation has no effect for methods without default arguments"); + MAP.put(ErrorsJvm.OVERLOADS_ABSTRACT, "'@JvmOverloads' annotation cannot be used on abstract methods"); + MAP.put(ErrorsJvm.OVERLOADS_PRIVATE, "'@JvmOverloads' annotation has no effect on private and local declarations"); + MAP.put(ErrorsJvm.INAPPLICABLE_JVM_NAME, "'@JvmName' annotation is not applicable to this declaration"); MAP.put(ErrorsJvm.ILLEGAL_JVM_NAME, "Illegal JVM name"); - MAP.put(ErrorsJvm.VOLATILE_ON_VALUE, "''@Volatile'' annotation cannot be used on immutable properties"); - MAP.put(ErrorsJvm.VOLATILE_ON_DELEGATE, "''@Volatile'' annotation cannot be used on delegated properties"); - MAP.put(ErrorsJvm.SYNCHRONIZED_ON_ABSTRACT, "''@Synchronized'' annotation cannot be used on abstract functions"); + MAP.put(ErrorsJvm.VOLATILE_ON_VALUE, "'@Volatile' annotation cannot be used on immutable properties"); + MAP.put(ErrorsJvm.VOLATILE_ON_DELEGATE, "'@Volatile' annotation cannot be used on delegated properties"); + MAP.put(ErrorsJvm.SYNCHRONIZED_ON_ABSTRACT, "'@Synchronized' annotation cannot be used on abstract functions"); MAP.put(ErrorsJvm.EXTERNAL_DECLARATION_CANNOT_BE_ABSTRACT, "External declaration can not be abstract"); MAP.put(ErrorsJvm.EXTERNAL_DECLARATION_CANNOT_HAVE_BODY, "External declaration can not have a body"); MAP.put(ErrorsJvm.EXTERNAL_DECLARATION_IN_INTERFACE, "Members of interfaces can not be external"); @@ -101,9 +101,9 @@ public class DefaultErrorMessagesJvm implements DefaultErrorMessages.Extension { MAP.put(ErrorsJvm.INAPPLICABLE_JVM_FIELD, "{0}", Renderers.TO_STRING); - MAP.put(ErrorsJvm.JVM_SYNTHETIC_ON_DELEGATE, "''@JvmSynthetic'' annotation cannot be used on delegated properties"); + MAP.put(ErrorsJvm.JVM_SYNTHETIC_ON_DELEGATE, "'@JvmSynthetic' annotation cannot be used on delegated properties"); - MAP.put(ErrorsJvm.STRICTFP_ON_CLASS, "''@Strictfp'' annotation on classes is unsupported yet"); + MAP.put(ErrorsJvm.STRICTFP_ON_CLASS, "'@Strictfp' annotation on classes is unsupported yet"); MAP.put(ErrorsJvm.SUPER_CALL_WITH_DEFAULT_PARAMETERS, "Super-calls with default arguments are not allowed. Please specify all arguments of ''super.{0}'' explicitly", Renderers.TO_STRING); } 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 817e13af1ff..310905bbe01 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/rendering/DefaultErrorMessages.java @@ -146,14 +146,14 @@ public class DefaultErrorMessages { MAP.put(INAPPLICABLE_TARGET_ON_PROPERTY, "''@{0}:'' annotations could be applied only to property declarations", TO_STRING); 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_PARAM_TARGET, "''@param:'' annotations could be applied only to primary constructor parameters"); + 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_PARAM_TARGET, "'@param:' annotations could be applied only to primary constructor parameters"); MAP.put(REDUNDANT_ANNOTATION_TARGET, "Redundant annotation target ''{0}''", STRING); MAP.put(REDUNDANT_MODIFIER, "Modifier ''{0}'' is redundant because ''{1}'' is present", TO_STRING, TO_STRING); - MAP.put(ABSTRACT_MODIFIER_IN_INTERFACE, "Modifier ''abstract'' is redundant in interface"); + MAP.put(ABSTRACT_MODIFIER_IN_INTERFACE, "Modifier 'abstract' is redundant in interface"); MAP.put(REDUNDANT_MODIFIER_IN_GETTER, "Visibility modifiers are redundant in getter"); MAP.put(TYPE_PARAMETERS_IN_ENUM, "Enum class cannot have type parameters"); MAP.put(TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, @@ -236,8 +236,8 @@ public class DefaultErrorMessages { MAP.put(NON_MEMBER_FUNCTION_NO_BODY, "Function ''{0}'' must have a body", NAME); MAP.put(FUNCTION_DECLARATION_WITH_NO_NAME, "Function declaration must have a name"); MAP.put(ANONYMOUS_FUNCTION_WITH_NAME, "Anonymous functions with names are prohibited"); - MAP.put(NON_FINAL_MEMBER_IN_FINAL_CLASS, "\"open\" has no effect in a final class"); - MAP.put(NON_FINAL_MEMBER_IN_OBJECT, "\"open\" has no effect in an object"); + MAP.put(NON_FINAL_MEMBER_IN_FINAL_CLASS, "'open' has no effect in a final class"); + MAP.put(NON_FINAL_MEMBER_IN_OBJECT, "'open' has no effect in an object"); MAP.put(ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE, "An anonymous function is not allowed to specify default values for its parameters"); MAP.put(USELESS_VARARG_ON_PARAMETER, "Vararg on this parameter is useless"); @@ -270,7 +270,7 @@ public class DefaultErrorMessages { MAP.put(VAL_REASSIGNMENT, "Val cannot be reassigned", NAME); MAP.put(CAPTURED_VAL_INITIALIZATION, "Captured values initialization is forbidden due to possible reassignment", NAME); MAP.put(SETTER_PROJECTED_OUT, "Setter for ''{0}'' is removed by type projection", NAME); - MAP.put(INVISIBLE_SETTER, "Cannot assign to ''{0}'': the setter is ''{1}'' in {2}", NAME, TO_STRING, NAME_OF_PARENT_OR_FILE); + MAP.put(INVISIBLE_SETTER, "Cannot assign to ''{0}'': the setter is {1} in {2}", NAME, TO_STRING, NAME_OF_PARENT_OR_FILE); MAP.put(INITIALIZATION_BEFORE_DECLARATION, "Variable cannot be initialized before declaration", NAME); MAP.put(VARIABLE_EXPECTED, "Variable expected"); @@ -315,7 +315,7 @@ public class DefaultErrorMessages { MAP.put(EQUALS_MISSING, "No method 'equals(Any?): Boolean' available"); MAP.put(ASSIGNMENT_IN_EXPRESSION_CONTEXT, "Assignments are not expressions, and only expressions are allowed in this context"); - MAP.put(SUPER_IS_NOT_AN_EXPRESSION, "''{0}'' is not an expression, it can only be used on the left-hand side of a dot ('.')", STRING); + MAP.put(SUPER_IS_NOT_AN_EXPRESSION, "''{0}'' is not an expression, it can only be used on the left-hand side of a dot (''.'')", STRING); MAP.put(SUPER_CANT_BE_EXTENSION_RECEIVER, "''{0}'' is not an expression, it can not be used as a receiver for extension functions", STRING); MAP.put(DECLARATION_IN_ILLEGAL_CONTEXT, "Declarations are not allowed in this position"); MAP.put(SETTER_PARAMETER_WITH_DEFAULT_VALUE, "Setter parameters cannot have default values"); @@ -350,12 +350,12 @@ public class DefaultErrorMessages { MAP.put(HAS_NEXT_FUNCTION_NONE_APPLICABLE, "None of the hasNext() functions is applicable for iterator() of type ''{0}''", RENDER_TYPE); MAP.put(HAS_NEXT_FUNCTION_TYPE_MISMATCH, "The ''iterator().hasNext()'' function of the loop range must return Boolean, but returns {0}", RENDER_TYPE); - MAP.put(NEXT_MISSING, "next() cannot be called on iterator() of type ''{0}''", RENDER_TYPE); - MAP.put(NEXT_AMBIGUITY, "next() is ambiguous for iterator() of type ''{0}''", RENDER_TYPE); - MAP.put(NEXT_NONE_APPLICABLE, "None of the next() functions is applicable for iterator() of type ''{0}''", RENDER_TYPE); + MAP.put(NEXT_MISSING, "''next()'' cannot be called on ''iterator()'' of type ''{0}''", RENDER_TYPE); + MAP.put(NEXT_AMBIGUITY, "''next()'' is ambiguous for ''iterator()'' of type ''{0}''", RENDER_TYPE); + MAP.put(NEXT_NONE_APPLICABLE, "None of the ''next()'' functions is applicable for ''iterator()'' of type ''{0}''", RENDER_TYPE); - MAP.put(ITERATOR_MISSING, "For-loop range must have an iterator() method"); - MAP.put(ITERATOR_ON_NULLABLE, "Not nullable value required to call an iterator() method on for-loop range"); + MAP.put(ITERATOR_MISSING, "For-loop range must have an 'iterator()' method"); + MAP.put(ITERATOR_ON_NULLABLE, "Not nullable value required to call an 'iterator()' method on for-loop range"); MAP.put(ITERATOR_AMBIGUITY, "Method ''iterator()'' is ambiguous for this expression: {0}", AMBIGUOUS_CALLS); MAP.put(DELEGATE_SPECIAL_FUNCTION_MISSING, "Missing ''{0}'' method on delegate of type ''{1}''", STRING, RENDER_TYPE); @@ -372,11 +372,11 @@ public class DefaultErrorMessages { MAP.put(UNDERSCORE_IS_RESERVED, "Names _, __, ___, ..., are reserved in Kotlin"); MAP.put(INVALID_CHARACTERS, "Name {0}", STRING); - MAP.put(INAPPLICABLE_OPERATOR_MODIFIER, "'operator' modifier is inapplicable on this function: {0}", STRING); + MAP.put(INAPPLICABLE_OPERATOR_MODIFIER, "''operator'' modifier is inapplicable on this function: {0}", STRING); MAP.put(INAPPLICABLE_INFIX_MODIFIER, "'infix' modifier is inapplicable on this function"); - MAP.put(OPERATOR_MODIFIER_REQUIRED, "'operator' modifier is required on ''{0}'' in ''{1}''", NAME, STRING); - MAP.put(INFIX_MODIFIER_REQUIRED, "'infix' modifier is required on ''{0}'' in ''{1}''", NAME, STRING); + MAP.put(OPERATOR_MODIFIER_REQUIRED, "''operator'' modifier is required on ''{0}'' in ''{1}''", NAME, STRING); + MAP.put(INFIX_MODIFIER_REQUIRED, "''infix'' modifier is required on ''{0}'' in ''{1}''", NAME, STRING); MAP.put(RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY, "Returns are not allowed for functions with expression body. Use block body in '{...}'"); @@ -429,8 +429,8 @@ public class DefaultErrorMessages { MAP.put(ELSE_MISPLACED_IN_WHEN, "'else' entry must be the last one in a when-expression"); MAP.put(COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT, "Deprecated syntax. Use '||' instead of commas in when-condition for 'when' without argument"); - MAP.put(NO_ELSE_IN_WHEN, "'when' expression must be exhaustive, add necessary {0}", RENDER_WHEN_MISSING_CASES); - MAP.put(NON_EXHAUSTIVE_WHEN, "'when' expression on enum is recommended to be exhaustive, add {0}", RENDER_WHEN_MISSING_CASES); + MAP.put(NO_ELSE_IN_WHEN, "''when'' expression must be exhaustive, add necessary {0}", RENDER_WHEN_MISSING_CASES); + MAP.put(NON_EXHAUSTIVE_WHEN, "''when'' expression on enum is recommended to be exhaustive, add {0}", RENDER_WHEN_MISSING_CASES); MAP.put(TYPE_MISMATCH_IN_RANGE, "Type mismatch: incompatible types of range and element checked in it"); MAP.put(CYCLIC_INHERITANCE_HIERARCHY, "There's a cycle in the inheritance hierarchy for this type"); @@ -479,7 +479,7 @@ public class DefaultErrorMessages { MAP.put(DYNAMIC_SUPERTYPE, "A supertype cannot be dynamic"); MAP.put(REDUNDANT_NULLABLE, "Redundant '?'"); MAP.put(UNSAFE_CALL, "Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type {0}", RENDER_TYPE); - MAP.put(UNSAFE_IMPLICIT_INVOKE_CALL, "Reference has a nullable type {0}, use explicit '?.invoke()' to make function-like call instead", RENDER_TYPE); + 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(EXCEPTION_FROM_ANALYZER, "Internal Error occurred while analyzing this expression:\n{0}", THROWABLE); @@ -539,8 +539,8 @@ public class DefaultErrorMessages { RENDER_TYPE); MAP.put(TYPE_MISMATCH_IN_CONDITION, "Condition must be of type Boolean, but is of type {0}", RENDER_TYPE); MAP.put(INCOMPATIBLE_TYPES, "Incompatible types: {0} and {1}", RENDER_TYPE, RENDER_TYPE); - MAP.put(IMPLICIT_NOTHING_RETURN_TYPE, "''Nothing'' return type needs to be specified explicitly"); - MAP.put(IMPLICIT_NOTHING_PROPERTY_TYPE, "''Nothing'' property type needs to be specified explicitly"); + MAP.put(IMPLICIT_NOTHING_RETURN_TYPE, "'Nothing' return type needs to be specified explicitly"); + MAP.put(IMPLICIT_NOTHING_PROPERTY_TYPE, "'Nothing' property type needs to be specified explicitly"); MAP.put(IMPLICIT_INTERSECTION_TYPE, "Inferred type {0} is an intersection, please specify the required type explicitly", RENDER_TYPE); MAP.put(EXPECTED_CONDITION, "Expected condition of type Boolean"); @@ -584,7 +584,7 @@ public class DefaultErrorMessages { MAP.put(OVERRIDING_FINAL_MEMBER_BY_DELEGATION, "''{0}'' implicitly overrides a final member ''{1}'' by delegation", SHORT_NAMES_IN_TYPES, SHORT_NAMES_IN_TYPES); - MAP.put(VAR_OVERRIDDEN_BY_VAL_BY_DELEGATION, "val-property ''{0}'' implicitly overrides a var-property ''{1}'' by delegation", + MAP.put(VAR_OVERRIDDEN_BY_VAL_BY_DELEGATION, "Val-property ''{0}'' implicitly overrides a var-property ''{1}'' by delegation", SHORT_NAMES_IN_TYPES, SHORT_NAMES_IN_TYPES); MAP.put(VAR_OVERRIDDEN_BY_VAL, "Var-property {0} cannot be overridden by val-property {1}", FQ_NAMES_IN_TYPES, FQ_NAMES_IN_TYPES); @@ -604,7 +604,7 @@ public class DefaultErrorMessages { DECLARATION_NAME_WITH_KIND); MAP.put(FUNCTION_EXPECTED, "Expression ''{0}''{1} cannot be invoked as a function. " + - "The function '" + OperatorNameConventions.INVOKE.asString() + "()' is not found", + "The function ''" + OperatorNameConventions.INVOKE.asString() + "()'' is not found", ELEMENT_TEXT, new DiagnosticParameterRenderer() { @NotNull @Override @@ -626,7 +626,7 @@ public class DefaultErrorMessages { MAP.put(RESULT_TYPE_MISMATCH, "{0} must return {1} but returns {2}", STRING, RENDER_TYPE, RENDER_TYPE); MAP.put(UNSAFE_INFIX_CALL, "Infix call corresponds to a dot-qualified call ''{0}.{1}({2})'' which is not allowed on a nullable receiver ''{0}''. " + - "Use '?.'-qualified call instead", + "Use ''?.''-qualified call instead", STRING, STRING, STRING); MAP.put(OVERLOAD_RESOLUTION_AMBIGUITY, "Overload resolution ambiguity: {0}", AMBIGUOUS_CALLS); @@ -681,7 +681,7 @@ public class DefaultErrorMessages { MAP.put(CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT, "Const 'val' are only allowed on top level or in objects"); MAP.put(CONST_VAL_WITH_DELEGATE, "Const 'val' should not have a delegate"); MAP.put(CONST_VAL_WITH_GETTER, "Const 'val' should not have a getter"); - MAP.put(TYPE_CANT_BE_USED_FOR_CONST_VAL, "Const 'val' has type ''{0}''. Only primitives and String are allowed", RENDER_TYPE); + MAP.put(TYPE_CANT_BE_USED_FOR_CONST_VAL, "Const ''val'' has type ''{0}''. Only primitives and String are allowed", RENDER_TYPE); MAP.put(CONST_VAL_WITHOUT_INITIALIZER, "Const 'val' should have an initializer"); MAP.put(CONST_VAL_WITH_NON_CONST_INITIALIZER, "Const 'val' initializer should be a constant value"); MAP.put(NON_CONST_VAL_USED_IN_CONSTANT_EXPRESSION, "Only 'const val' can be used in constant expressions"); @@ -725,7 +725,7 @@ public class DefaultErrorMessages { MAP.put(NON_PUBLIC_CALL_FROM_PUBLIC_INLINE, "Public-API inline function cannot access non-public-API ''{0}''", SHORT_NAMES_IN_TYPES, SHORT_NAMES_IN_TYPES); MAP.put(PRIVATE_CLASS_MEMBER_FROM_INLINE, "Non-private inline function cannot access members of private classes: ''{0}''", SHORT_NAMES_IN_TYPES, SHORT_NAMES_IN_TYPES); MAP.put(NOT_YET_SUPPORTED_IN_INLINE, "''{0}'' construction is not yet supported in inline functions", ELEMENT_TEXT, SHORT_NAMES_IN_TYPES); - MAP.put(DECLARATION_CANT_BE_INLINED, "''inline'' modifier is not allowed on virtual members. Only private or final members can be inlined"); + MAP.put(DECLARATION_CANT_BE_INLINED, "'inline' modifier is not allowed on virtual members. Only private or final members can be inlined"); MAP.put(NOTHING_TO_INLINE, "Expected performance impact of inlining ''{0}'' can be insignificant. Inlining works best for functions with lambda parameters", SHORT_NAMES_IN_TYPES); MAP.put(USAGE_IS_NOT_INLINABLE, "Illegal usage of inline-parameter ''{0}'' in ''{1}''. Add ''noinline'' modifier to the parameter declaration", ELEMENT_TEXT, SHORT_NAMES_IN_TYPES); MAP.put(NULLABLE_INLINE_PARAMETER, "Inline-parameter ''{0}'' of ''{1}'' must not be nullable. Add ''noinline'' modifier to the parameter declaration or make its type not nullable", ELEMENT_TEXT, SHORT_NAMES_IN_TYPES); diff --git a/idea/testData/checker/JvmStaticUsagesRuntime.kt b/idea/testData/checker/JvmStaticUsagesRuntime.kt index 75497bc8086..3e6f1e62667 100644 --- a/idea/testData/checker/JvmStaticUsagesRuntime.kt +++ b/idea/testData/checker/JvmStaticUsagesRuntime.kt @@ -16,13 +16,13 @@ class A { fun test() { val s = object { - @JvmStatic fun a3() { + @JvmStatic fun a3() { } } } - @JvmStatic fun a4() { + @JvmStatic fun a4() { } } @@ -30,7 +30,7 @@ class A { @JvmStatic interface B { companion object { - @JvmStatic fun a1() { + @JvmStatic fun a1() { } } @@ -43,13 +43,13 @@ interface B { fun test() { val s = object { - @JvmStatic fun a3() { + @JvmStatic fun a3() { } } } - @JvmStatic fun a4() { + @JvmStatic fun a4() { } -} \ No newline at end of file +} diff --git a/idea/testData/checker/SafeInvoke.kt b/idea/testData/checker/SafeInvoke.kt index b2dd94c3b95..db9c7b6a7c3 100644 --- a/idea/testData/checker/SafeInvoke.kt +++ b/idea/testData/checker/SafeInvoke.kt @@ -2,7 +2,7 @@ class Rule(val apply: () -> Unit) fun foo() { val rule: Rule? = Rule { } - rule?.apply() + rule?.apply() val apply = rule?.apply - apply() -} \ No newline at end of file + apply() +} diff --git a/idea/testData/checker/WhenNonExhaustive.kt b/idea/testData/checker/WhenNonExhaustive.kt index db7c914a8f8..35683853d4a 100644 --- a/idea/testData/checker/WhenNonExhaustive.kt +++ b/idea/testData/checker/WhenNonExhaustive.kt @@ -1,12 +1,12 @@ -fun nonExhaustiveInt(x: Int) = when(x) { +fun nonExhaustiveInt(x: Int) = when(x) { 0 -> false } -fun nonExhaustiveBoolean(b: Boolean) = when(b) { +fun nonExhaustiveBoolean(b: Boolean) = when(b) { false -> 0 } -fun nonExhaustiveNullableBoolean(b: Boolean?) = when(b) { +fun nonExhaustiveNullableBoolean(b: Boolean?) = when(b) { false -> 0 true -> 1 } @@ -17,17 +17,17 @@ enum class Color { BLUE } -fun nonExhaustiveEnum(c: Color) = when(c) { +fun nonExhaustiveEnum(c: Color) = when(c) { Color.GREEN -> 0xff00 } -fun nonExhaustiveNullable(c: Color?) = when(c) { +fun nonExhaustiveNullable(c: Color?) = when(c) { Color.RED -> 0xff Color.BLUE -> 0xff0000 } fun whenOnEnum(c: Color) { - when(c) { + when(c) { Color.BLUE -> {} Color.GREEN -> {} } @@ -37,7 +37,7 @@ enum class EnumInt { A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15 } -fun whenOnLongEnum(i: EnumInt) = when (i) { +fun whenOnLongEnum(i: EnumInt) = when (i) { EnumInt.A7 -> 7 } @@ -49,17 +49,17 @@ sealed class Variant { object Another : Variant() } -fun nonExhaustiveSealed(v: Variant) = when(v) { +fun nonExhaustiveSealed(v: Variant) = when(v) { Variant.Singleton -> false } -fun nonExhaustiveNullableSealed(v: Variant?) = when(v) { +fun nonExhaustiveNullableSealed(v: Variant?) = when(v) { Variant.Singleton -> false is Variant.Something -> true } sealed class Empty -fun nonExhaustiveEmpty(e: Empty) = when(e) {} +fun nonExhaustiveEmpty(e: Empty) = when(e) {} -fun nonExhaustiveNullableEmpty(e: Empty?) = when(e) {} +fun nonExhaustiveNullableEmpty(e: Empty?) = when(e) {} diff --git a/idea/testData/checker/infos/SmartCasts.kt b/idea/testData/checker/infos/SmartCasts.kt index 8ff8a115325..5bb4f83228e 100644 --- a/idea/testData/checker/infos/SmartCasts.kt +++ b/idea/testData/checker/infos/SmartCasts.kt @@ -264,5 +264,5 @@ fun inForLoop(x: Any?) { if (x is Array<*>) { for (i in x) {} } - for (i in x) {} + for (i in x) {} } diff --git a/idea/testData/copyPaste/imports/JavaStaticViaClass.expected.kt b/idea/testData/copyPaste/imports/JavaStaticViaClass.expected.kt index 18288121ee2..e5bb6de59be 100644 --- a/idea/testData/copyPaste/imports/JavaStaticViaClass.expected.kt +++ b/idea/testData/copyPaste/imports/JavaStaticViaClass.expected.kt @@ -1,4 +1,4 @@ -// ERROR: Expression 'staticField' of type 'Int' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'staticField' of type 'Int' cannot be invoked as a function. The function 'invoke()' is not found package to import a.JavaF diff --git a/idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt b/idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt index 7052781ca46..e3cf013787a 100644 --- a/idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt +++ b/idea/testData/intentions/branched/ifThenToDoubleBang/conditionNotBinaryExpr.kt @@ -2,7 +2,7 @@ // IS_APPLICABLE: false // ERROR: Type mismatch: inferred type is Int but Boolean was expected // ERROR: Condition must be of type Boolean, but is of type Int -// ERROR: Infix call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'. Use ?.-qualified call instead +// ERROR: Infix call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'. Use '?.'-qualified call instead fun String?.times(a: Int): Boolean = a == 0 diff --git a/idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt b/idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt index 68a98e799db..c999f15f79a 100644 --- a/idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt +++ b/idea/testData/intentions/branched/ifThenToElvis/conditionNotBinaryExpr.kt @@ -1,7 +1,7 @@ // IS_APPLICABLE: false // ERROR: Type mismatch: inferred type is Int but Boolean was expected // ERROR: Condition must be of type Boolean, but is of type Int -// ERROR: Infix call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'. Use ?.-qualified call instead +// ERROR: Infix call corresponds to a dot-qualified call 'foo.times(10)' which is not allowed on a nullable receiver 'foo'. Use '?.'-qualified call instead fun main(args: Array) { val foo: Int? = 4 diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/missingDefaultArgument.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/missingDefaultArgument.kt index 10ef9e3a5c7..3c3105a53df 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/missingDefaultArgument.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/missingDefaultArgument.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun plus(a: Int=1, b: Int=2) : Int = 0 diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/multipleArguments.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/multipleArguments.kt index 25b7e9d1fda..cc057649521 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/multipleArguments.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/multipleArguments.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test { operator fun plus(a: Int, b: Int): Test = Test() diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/unacceptableVararg1.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/unacceptableVararg1.kt index 624311f8dd7..ff65dc788f3 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/unacceptableVararg1.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/unacceptableVararg1.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun plus(vararg b: Int, c: Int = 0): Int = 0 diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/unacceptableVararg2.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/unacceptableVararg2.kt index 61c19972764..df2c6685b7d 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/unacceptableVararg2.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithBinaryOperator/unacceptableVararg2.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun plus(vararg b: Int, c: Int = 0): Int = 0 diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/functionLiteralArgument.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/functionLiteralArgument.kt index f1c1feba5ee..75e89f89ca2 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/functionLiteralArgument.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/functionLiteralArgument.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have no value parameters +// ERROR: 'operator' modifier is inapplicable on this function: must have no value parameters fun test() { class Test { operator fun unaryPlus(fn: () -> Unit): Test = Test() diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/namedValueArgument.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/namedValueArgument.kt index 4ed8b58fcc1..4f8bac30ca0 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/namedValueArgument.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/namedValueArgument.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have no value parameters +// ERROR: 'operator' modifier is inapplicable on this function: must have no value parameters fun test() { class Test { operator fun unaryPlus(a: Int): Test = Test() diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/unacceptableVararg.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/unacceptableVararg.kt index 160c3bc6da8..54727e82e96 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/unacceptableVararg.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/unacceptableVararg.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have no value parameters +// ERROR: 'operator' modifier is inapplicable on this function: must have no value parameters fun test() { class Test { operator fun unaryPlus(vararg a: Int): Test = Test() diff --git a/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/valueArgument.kt b/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/valueArgument.kt index ff21dd08fc9..591d660df51 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/valueArgument.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceCallWithUnaryOperator/valueArgument.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have no value parameters +// ERROR: 'operator' modifier is inapplicable on this function: must have no value parameters fun test() { class Test { operator fun unaryPlus(a: Int): Test = Test() diff --git a/idea/testData/intentions/conventionNameCalls/replaceContains/invalidArgument.kt b/idea/testData/intentions/conventionNameCalls/replaceContains/invalidArgument.kt index 9d189e20d0f..d35cca01361 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceContains/invalidArgument.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceContains/invalidArgument.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: false // ERROR: Cannot find a parameter with this name: c -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun contains(a: Int=1, b: Int=2): Boolean = true diff --git a/idea/testData/intentions/conventionNameCalls/replaceContains/missingArgument.kt b/idea/testData/intentions/conventionNameCalls/replaceContains/missingArgument.kt index d51337f41a0..4b4312c6bee 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceContains/missingArgument.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceContains/missingArgument.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: false // ERROR: No value passed for parameter b -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun contains(a: Int, b: Int): Boolean = true diff --git a/idea/testData/intentions/conventionNameCalls/replaceContains/missingDefaultArgument.kt b/idea/testData/intentions/conventionNameCalls/replaceContains/missingDefaultArgument.kt index 6da0a95800a..e84417350ea 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceContains/missingDefaultArgument.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceContains/missingDefaultArgument.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun contains(a: Int=1, b: Int=2) : Boolean = true diff --git a/idea/testData/intentions/conventionNameCalls/replaceContains/multipleArguments.kt b/idea/testData/intentions/conventionNameCalls/replaceContains/multipleArguments.kt index ee0d90faec3..7ae7a02f785 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceContains/multipleArguments.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceContains/multipleArguments.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun contains(a: Int, b: Int) : Boolean = true diff --git a/idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg1.kt b/idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg1.kt index a8db40e29c0..851a73a6693 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg1.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg1.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun contains(vararg b: Int, c: Int = 0): Boolean = true diff --git a/idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg2.kt b/idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg2.kt index 3f918541f41..5f9ed84d9b3 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg2.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceContains/unacceptableVararg2.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have a single value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have a single value parameter fun test() { class Test{ operator fun contains(vararg b: Int, c: Int = 0): Boolean = true diff --git a/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/noArgument.kt b/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/noArgument.kt index 2a5dace1483..4dca5e57b29 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/noArgument.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/noArgument.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have at least 1 value parameter +// ERROR: 'operator' modifier is inapplicable on this function: must have at least 1 value parameter fun test() { class Test{ operator fun get() : Int = 0 diff --git a/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/setWithNoParameters.kt b/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/setWithNoParameters.kt index d6dce506a39..428d8a8cb60 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/setWithNoParameters.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/setWithNoParameters.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must have at least 2 value parameters +// ERROR: 'operator' modifier is inapplicable on this function: must have at least 2 value parameters class C { operator fun set(){} diff --git a/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/setWithVararg.kt b/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/setWithVararg.kt index 85e04e26ba2..78ef6e01c1e 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/setWithVararg.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/setWithVararg.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: last parameter should not have a default value or be a vararg +// ERROR: 'operator' modifier is inapplicable on this function: last parameter should not have a default value or be a vararg class C { operator fun set(s: String, vararg value: Int): Boolean = true diff --git a/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/topLevelFun.kt b/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/topLevelFun.kt index 7a1a87467e8..896f1ee5712 100644 --- a/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/topLevelFun.kt +++ b/idea/testData/intentions/conventionNameCalls/replaceGetOrSet/topLevelFun.kt @@ -1,5 +1,5 @@ // IS_APPLICABLE: false -// ERROR: operator modifier is inapplicable on this function: must be a member or an extension +// ERROR: 'operator' modifier is inapplicable on this function: must be a member or an extension package p diff --git a/idea/testData/intentions/swapBinaryExpression/is.kt b/idea/testData/intentions/swapBinaryExpression/is.kt index 3ad48a4cd3d..b1db5e9f90d 100644 --- a/idea/testData/intentions/swapBinaryExpression/is.kt +++ b/idea/testData/intentions/swapBinaryExpression/is.kt @@ -1,6 +1,6 @@ // IS_APPLICABLE: false // ERROR: 'if' must have both main and 'else' branches if used as an expression -// ERROR: Expression 'if "test" is String' of type 'Unit' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'if "test" is String' of type 'Unit' cannot be invoked as a function. The function 'invoke()' is not found fun doSomething(a: T) {} diff --git a/idea/testData/quickfix/autoImports/indexCallExtensionImportGetOnNoOperatorWarning.test b/idea/testData/quickfix/autoImports/indexCallExtensionImportGetOnNoOperatorWarning.test index 3b640bd1022..615ba10c5e0 100644 --- a/idea/testData/quickfix/autoImports/indexCallExtensionImportGetOnNoOperatorWarning.test +++ b/idea/testData/quickfix/autoImports/indexCallExtensionImportGetOnNoOperatorWarning.test @@ -1,6 +1,6 @@ // FILE: first.before.kt // "Import" "true" -// ERROR: operator modifier is required on 'get' in 'some.Some' +// ERROR: 'operator' modifier is required on 'get' in 'some.Some' package testing @@ -27,7 +27,7 @@ operator fun Some.get(s: String) {} // FILE: first.after.kt // "Import" "true" -// ERROR: operator modifier is required on 'get' in 'some.Some' +// ERROR: 'operator' modifier is required on 'get' in 'some.Some' package testing diff --git a/idea/testData/quickfix/autoImports/indexCallExtensionImportSetOnNoOperatorWarning.test b/idea/testData/quickfix/autoImports/indexCallExtensionImportSetOnNoOperatorWarning.test index 51a3f47e6f5..410c418aa6a 100644 --- a/idea/testData/quickfix/autoImports/indexCallExtensionImportSetOnNoOperatorWarning.test +++ b/idea/testData/quickfix/autoImports/indexCallExtensionImportSetOnNoOperatorWarning.test @@ -1,6 +1,6 @@ // FILE: first.before.kt // "Import" "true" -// ERROR: operator modifier is required on 'set' in 'some.Some' +// ERROR: 'operator' modifier is required on 'set' in 'some.Some' package testing @@ -27,7 +27,7 @@ operator fun Some.set(s: String, i: Int) {} // FILE: first.after.kt // "Import" "true" -// ERROR: operator modifier is required on 'set' in 'some.Some' +// ERROR: 'operator' modifier is required on 'set' in 'some.Some' package testing diff --git a/idea/testData/quickfix/autoImports/invokeExtension.test b/idea/testData/quickfix/autoImports/invokeExtension.test index def0d6438b7..142bb4955ea 100644 --- a/idea/testData/quickfix/autoImports/invokeExtension.test +++ b/idea/testData/quickfix/autoImports/invokeExtension.test @@ -1,6 +1,6 @@ // FILE: first.before.kt // "Import" "true" -// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found package testing @@ -14,7 +14,7 @@ fun testing() { // FILE: second.kt // "Import" "true" -// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found package some @@ -26,7 +26,7 @@ operator fun Some.invoke(s: String) {} // FILE: first.after.kt // "Import" "true" -// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found package testing diff --git a/idea/testData/quickfix/autoImports/invokeExtensionNoOperator.test b/idea/testData/quickfix/autoImports/invokeExtensionNoOperator.test index 82f6cd33630..f9729d32f7a 100644 --- a/idea/testData/quickfix/autoImports/invokeExtensionNoOperator.test +++ b/idea/testData/quickfix/autoImports/invokeExtensionNoOperator.test @@ -1,6 +1,6 @@ // FILE: first.before.kt // "Import" "false" -// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found // ACTION: Create extension function 'invoke' // ACTION: Create member function 'invoke' @@ -17,7 +17,7 @@ fun testing() { // FILE: second.kt // "Import" "true" -// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found package some @@ -29,7 +29,7 @@ fun Some.invoke(s: String) {} // FILE: first.after.kt // "Import" "true" -// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'Some()' of type 'Some' cannot be invoked as a function. The function 'invoke()' is not found // ACTION: Create extension function 'invoke' // ACTION: Create member function 'invoke' diff --git a/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt b/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt index 3ac3b280688..27ee2e07cb2 100644 --- a/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt +++ b/idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt @@ -1,6 +1,6 @@ // "Add non-null asserted (!!) call" "false" // ACTION: Replace with a 'forEach' function call -// ERROR: Not nullable value required to call an iterator() method on for-loop range +// ERROR: Not nullable value required to call an 'iterator()' method on for-loop range class Some { fun iterator(): Iterator = null!! diff --git a/idea/testData/quickfix/modifiers/operatorModifierComponent.kt b/idea/testData/quickfix/modifiers/operatorModifierComponent.kt index a75e03ccaf4..29c025f0d96 100644 --- a/idea/testData/quickfix/modifiers/operatorModifierComponent.kt +++ b/idea/testData/quickfix/modifiers/operatorModifierComponent.kt @@ -1,5 +1,5 @@ // "Add 'operator' modifier" "true" -// ERROR: operator modifier is required on 'component2' in 'A' +// ERROR: 'operator' modifier is required on 'component2' in 'A' class A { fun component1(): Int = 0 diff --git a/idea/testData/quickfix/modifiers/operatorModifierComponent.kt.after b/idea/testData/quickfix/modifiers/operatorModifierComponent.kt.after index a8783f40f3b..5aec69a8bed 100644 --- a/idea/testData/quickfix/modifiers/operatorModifierComponent.kt.after +++ b/idea/testData/quickfix/modifiers/operatorModifierComponent.kt.after @@ -1,5 +1,5 @@ // "Add 'operator' modifier" "true" -// ERROR: operator modifier is required on 'component2' in 'A' +// ERROR: 'operator' modifier is required on 'component2' in 'A' class A { operator fun component1(): Int = 0 diff --git a/idea/testData/quickfix/privateInFiles/privateTopLevelVarWithSetterInFile.after.kt b/idea/testData/quickfix/privateInFiles/privateTopLevelVarWithSetterInFile.after.kt index c60aa2a3653..36101fdd3ba 100644 --- a/idea/testData/quickfix/privateInFiles/privateTopLevelVarWithSetterInFile.after.kt +++ b/idea/testData/quickfix/privateInFiles/privateTopLevelVarWithSetterInFile.after.kt @@ -1,5 +1,5 @@ // "Make internal" "true" -// ERROR: Cannot assign to 'prop': the setter is 'private' in file +// ERROR: Cannot assign to 'prop': the setter is private in file package test diff --git a/idea/testData/quickfix/privateInFiles/privateTopLevelVarWithSetterInFile.before.Main.kt b/idea/testData/quickfix/privateInFiles/privateTopLevelVarWithSetterInFile.before.Main.kt index 90c329e9094..dc19cec0f43 100644 --- a/idea/testData/quickfix/privateInFiles/privateTopLevelVarWithSetterInFile.before.Main.kt +++ b/idea/testData/quickfix/privateInFiles/privateTopLevelVarWithSetterInFile.before.Main.kt @@ -1,5 +1,5 @@ // "Make internal" "true" -// ERROR: Cannot assign to 'prop': the setter is 'private' in file +// ERROR: Cannot assign to 'prop': the setter is private in file package test diff --git a/idea/testData/quickfix/variables/changeToPropertyAccess/propertyCallWithArguments.kt b/idea/testData/quickfix/variables/changeToPropertyAccess/propertyCallWithArguments.kt index 40b5c6be327..49d119b420a 100644 --- a/idea/testData/quickfix/variables/changeToPropertyAccess/propertyCallWithArguments.kt +++ b/idea/testData/quickfix/variables/changeToPropertyAccess/propertyCallWithArguments.kt @@ -1,5 +1,5 @@ // "Change to property access" "false" -// ERROR: Expression 'fd' of type 'String' cannot be invoked as a function. The function invoke() is not found +// ERROR: Expression 'fd' of type 'String' cannot be invoked as a function. The function 'invoke()' is not found class A(val fd: String) fun x() { diff --git a/jps-plugin/testData/incremental/classHierarchyAffected/enumEntryAdded/build.log b/jps-plugin/testData/incremental/classHierarchyAffected/enumEntryAdded/build.log index b8d96cbc562..ff1a4bbd2cb 100644 --- a/jps-plugin/testData/incremental/classHierarchyAffected/enumEntryAdded/build.log +++ b/jps-plugin/testData/incremental/classHierarchyAffected/enumEntryAdded/build.log @@ -26,7 +26,7 @@ End of files Exit code: ABORT ------------------------------------------ COMPILATION FAILED -when expression must be exhaustive, add necessary 'C' branch or 'else' branch instead +'when' expression must be exhaustive, add necessary 'C' branch or 'else' branch instead ================ Step #2 ================= diff --git a/jps-plugin/testData/incremental/classHierarchyAffected/sealedClassImplAdded/build.log b/jps-plugin/testData/incremental/classHierarchyAffected/sealedClassImplAdded/build.log index eaaa6d520ec..5ea3c686357 100644 --- a/jps-plugin/testData/incremental/classHierarchyAffected/sealedClassImplAdded/build.log +++ b/jps-plugin/testData/incremental/classHierarchyAffected/sealedClassImplAdded/build.log @@ -22,7 +22,7 @@ End of files Exit code: ABORT ------------------------------------------ COMPILATION FAILED -when expression must be exhaustive, add necessary 'is C' branch or 'else' branch instead +'when' expression must be exhaustive, add necessary 'is C' branch or 'else' branch instead ================ Step #2 ================= diff --git a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/DefaultErrorMessagesJs.kt b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/DefaultErrorMessagesJs.kt index 820e2ced558..6e763bb52e3 100644 --- a/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/DefaultErrorMessagesJs.kt +++ b/js/js.frontend/src/org/jetbrains/kotlin/js/resolve/diagnostics/DefaultErrorMessagesJs.kt @@ -27,8 +27,8 @@ private val DIAGNOSTIC_FACTORY_TO_RENDERER by lazy { "Annotation ''{0}'' is allowed only on member functions of declaration annotated as ''kotlin.js.native'' or on toplevel extension functions", Renderers.RENDER_TYPE) put(ErrorsJs.NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER, "Native {0}''s first parameter type should be ''kotlin.String'' or subtype of ''kotlin.Number''", Renderers.STRING) put(ErrorsJs.NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS, "Native {0}''s parameter can not have default value", Renderers.STRING) - put(ErrorsJs.NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE, "Native getter''s return type should be nullable") - put(ErrorsJs.NATIVE_SETTER_WRONG_RETURN_TYPE, "Native setter''s return type should be ''Unit'' or a supertype of the second parameter''s type") + put(ErrorsJs.NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE, "Native getter's return type should be nullable") + put(ErrorsJs.NATIVE_SETTER_WRONG_RETURN_TYPE, "Native setter's return type should be 'Unit' or a supertype of the second parameter's type") put(ErrorsJs.NATIVE_INDEXER_WRONG_PARAMETER_COUNT, "Expected {0} parameters for native {1}", Renderers.TO_STRING, Renderers.STRING) put(ErrorsJs.JSCODE_ERROR, "JavaScript: {0}", JsCallDataTextRenderer) put(ErrorsJs.JSCODE_WARNING, "JavaScript: {0}", JsCallDataTextRenderer)