From de1c92a32f11e12947533975847ba1cfafc5b5fe Mon Sep 17 00:00:00 2001 From: Kirill Rakhman Date: Wed, 24 May 2023 16:30:54 +0200 Subject: [PATCH] [FIR] Update diagnostic messages --- .../js/FirJsErrorsDefaultMessages.kt | 118 +- .../jvm/FirJvmErrorsDefaultMessages.kt | 132 +- .../native/FirNativeErrorsDefaultMessages.kt | 50 +- .../declaration/FirContractChecker.kt | 8 +- .../FirContractNotFirstStatementChecker.kt | 4 +- .../diagnostics/FirDiagnosticRenderers.kt | 2 +- .../diagnostics/FirErrorsDefaultMessages.kt | 1179 ++++++++--------- .../builder/FirSyntaxErrorsDefaultMessages.kt | 3 +- .../KtDiagnosticFactoryToRendererMap.kt | 4 +- .../KtDefaultErrorMessagesParcelize.kt | 48 +- 10 files changed, 774 insertions(+), 774 deletions(-) diff --git a/compiler/fir/checkers/checkers.js/src/org/jetbrains/kotlin/fir/analysis/diagnostics/js/FirJsErrorsDefaultMessages.kt b/compiler/fir/checkers/checkers.js/src/org/jetbrains/kotlin/fir/analysis/diagnostics/js/FirJsErrorsDefaultMessages.kt index d525b19b70a..7ff702ae436 100644 --- a/compiler/fir/checkers/checkers.js/src/org/jetbrains/kotlin/fir/analysis/diagnostics/js/FirJsErrorsDefaultMessages.kt +++ b/compiler/fir/checkers/checkers.js/src/org/jetbrains/kotlin/fir/analysis/diagnostics/js/FirJsErrorsDefaultMessages.kt @@ -75,138 +75,138 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.js.FirJsErrors.WRONG_OPERAT @Suppress("unused") object FirJsErrorsDefaultMessages : BaseDiagnosticRendererFactory() { override val MAP = KtDiagnosticFactoryToRendererMap("FIR").also { map -> - map.put(WRONG_JS_QUALIFIER, "Qualifier contains illegal characters") - map.put(JS_MODULE_PROHIBITED_ON_VAR, "@JsModule and @JsNonModule annotations prohibited for 'var' declarations. Use 'val' instead.") - map.put(JS_MODULE_PROHIBITED_ON_NON_NATIVE, "@JsModule and @JsNonModule annotations prohibited for non-external declarations.") + map.put(WRONG_JS_QUALIFIER, "Qualifier contains illegal characters.") + map.put(JS_MODULE_PROHIBITED_ON_VAR, "'@JsModule' and '@JsNonModule' annotations are prohibited for 'var' declarations. Use 'val' instead.") + map.put(JS_MODULE_PROHIBITED_ON_NON_NATIVE, "'@JsModule' and '@JsNonModule' annotations are prohibited for non-external declarations.") map.put( NESTED_JS_MODULE_PROHIBITED, - "@JsModule and @JsNonModule can't appear on here since the file is already marked by either @JsModule or @JsNonModule" + "'@JsModule' and '@JsNonModule' cannot appear here since the file is already marked by either '@JsModule' or '@JsNonModule'." ) map.put( CALL_FROM_UMD_MUST_BE_JS_MODULE_AND_JS_NON_MODULE, - "When accessing module declarations from UMD, they must be marked by both @JsModule and @JsNonModule" + "When accessing module declarations from UMD, they must be marked with both @JsModule and @JsNonModule." ) map.put( CALL_TO_JS_MODULE_WITHOUT_MODULE_SYSTEM, - "Can''t access {0} marked with @JsModule annotation from non-modular project", FirDiagnosticRenderers.SYMBOL + "Can''t access ''{0}'' marked with @JsModule annotation from non-modular project.", FirDiagnosticRenderers.SYMBOL ) map.put( CALL_TO_JS_NON_MODULE_WITH_MODULE_SYSTEM, - "Can''t access {0} marked with @JsNonModule annotation from modular project", FirDiagnosticRenderers.SYMBOL + "Can''t access ''{0}'' marked with @JsNonModule annotation from modular project.", FirDiagnosticRenderers.SYMBOL ) map.put( WRONG_MULTIPLE_INHERITANCE, - "Can''t apply multiple inheritance here, since it''s impossible to generate bridge for system function {0}", + "Multiple inheritance cannot be used here, since it''s impossible to generate a bridge for system function {0}.", FirDiagnosticRenderers.SYMBOL ) - map.put(DELEGATION_BY_DYNAMIC, "Can't delegate to dynamic value") - map.put(PROPERTY_DELEGATION_BY_DYNAMIC, "Can't apply property delegation by dynamic handler") - map.put(SPREAD_OPERATOR_IN_DYNAMIC_CALL, "Can't apply spread operator in dynamic call") - map.put(WRONG_OPERATION_WITH_DYNAMIC, "Wrong operation with dynamic value: {0}", CommonRenderers.STRING) - map.put(IMPLEMENTING_FUNCTION_INTERFACE, "Implementing function interface is prohibited in JavaScript") - map.put(OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS, "Overriding `external` function with optional parameters") + map.put(DELEGATION_BY_DYNAMIC, "Cannot delegate to dynamic value.") + map.put(PROPERTY_DELEGATION_BY_DYNAMIC, "Cannot apply property delegation by dynamic handler.") + map.put(SPREAD_OPERATOR_IN_DYNAMIC_CALL, "Cannot apply spread operator in dynamic call.") + map.put(WRONG_OPERATION_WITH_DYNAMIC, "Wrong operation with dynamic value: {0}.", CommonRenderers.STRING) + map.put(IMPLEMENTING_FUNCTION_INTERFACE, "Implementing a function interface is prohibited in JavaScript.") + map.put(OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS, "Overriding 'external' function with optional parameters.") map.put( OVERRIDING_EXTERNAL_FUN_WITH_OPTIONAL_PARAMS_WITH_FAKE, - "Overriding `external` function with optional parameters by declaration from superclass: {0}", + "Overriding ''external'' function with optional parameters by declaration from superclass: {0}.", FirDiagnosticRenderers.SYMBOL ) - map.put(CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION, "This property can only be used from external declarations") - map.put(RUNTIME_ANNOTATION_ON_EXTERNAL_DECLARATION, "Runtime annotation can't be put on external declaration") + map.put(CALL_TO_DEFINED_EXTERNALLY_FROM_NON_EXTERNAL_DECLARATION, "This property can only be used from external declarations.") + map.put(RUNTIME_ANNOTATION_ON_EXTERNAL_DECLARATION, "Runtime annotation cannot be put on external declaration.") map.put( RUNTIME_ANNOTATION_NOT_SUPPORTED, - "Reflection is not supported in JavaScript target, therefore you won't be able to read this annotation in run-time" + "Reflection is not supported in JavaScript target; therefore, you won't be able to read this annotation at runtime." ) - map.put(EXTERNAL_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER, "External class constructor cannot have a property parameter") - map.put(EXTERNAL_ENUM_ENTRY_WITH_BODY, "Entry of external enum class can't have body") - map.put(EXTERNAL_ANONYMOUS_INITIALIZER, "Anonymous initializer is not allowed in external classes") - map.put(EXTERNAL_DELEGATION, "Can't use delegate on external declaration") - map.put(EXTERNAL_DELEGATED_CONSTRUCTOR_CALL, "Delegated constructor call in external class is not allowed") + map.put(EXTERNAL_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER, "External class constructor cannot have a property parameter.") + map.put(EXTERNAL_ENUM_ENTRY_WITH_BODY, "Entry of external enum class cannot have a body.") + map.put(EXTERNAL_ANONYMOUS_INITIALIZER, "Anonymous initializers in external classes are prohibited.") + map.put(EXTERNAL_DELEGATION, "Cannot use delegate on external declaration.") + map.put(EXTERNAL_DELEGATED_CONSTRUCTOR_CALL, "Delegated constructor call in external class is prohibited.") map.put( WRONG_BODY_OF_EXTERNAL_DECLARATION, - "Wrong body of external declaration. Must be either ' = definedExternally' or { definedExternally }" + "Wrong body of external declaration. Must be either ' = definedExternally' or '{ definedExternally }'." ) - map.put(WRONG_INITIALIZER_OF_EXTERNAL_DECLARATION, "Wrong initializer of external declaration. Must be ' = definedExternally'") + map.put(WRONG_INITIALIZER_OF_EXTERNAL_DECLARATION, "Wrong initializer of external declaration. Must be ' = definedExternally'.") map.put( WRONG_DEFAULT_VALUE_FOR_EXTERNAL_FUN_PARAMETER, - "Wrong default value for parameter of external function. Must be ' = definedExternally'" + "Wrong default value for parameter of external function. Must be ' = definedExternally'." ) - map.put(NESTED_EXTERNAL_DECLARATION, "Non-top-level `external` declaration") - map.put(WRONG_EXTERNAL_DECLARATION, "Declaration of such kind ({0}) can''t be external", CommonRenderers.STRING) - map.put(NESTED_CLASS_IN_EXTERNAL_INTERFACE, "Interface can't contain nested classes and objects") - map.put(EXTERNAL_TYPE_EXTENDS_NON_EXTERNAL_TYPE, "External type extends non-external type") - map.put(INLINE_EXTERNAL_DECLARATION, "Inline external declaration") + map.put(NESTED_EXTERNAL_DECLARATION, "Non-top-level 'external' declaration.") + map.put(WRONG_EXTERNAL_DECLARATION, "Declaration of such kind ({0}) cannot be external.", CommonRenderers.STRING) + map.put(NESTED_CLASS_IN_EXTERNAL_INTERFACE, "Interface cannot contain nested classes and objects.") + map.put(EXTERNAL_TYPE_EXTENDS_NON_EXTERNAL_TYPE, "External type extends non-external type.") + map.put(INLINE_EXTERNAL_DECLARATION, "Inline external declaration.") map.put( INLINE_CLASS_IN_EXTERNAL_DECLARATION_WARNING, - "Using value classes as parameter type or return type of external declarations is experimental" + "Using value classes as parameter type or return type of external declarations is experimental." ) map.put( ENUM_CLASS_IN_EXTERNAL_DECLARATION_WARNING, - "Using enum classes with an `external` qualifier becomes deprecated and will be an error in future releases" + "Using enum classes with an 'external' qualifier becomes deprecated and will be an error in future releases." ) map.put( INLINE_CLASS_IN_EXTERNAL_DECLARATION, - "Using value classes as parameter type or return type of external declarations is not supported" + "Using value classes as parameter type or return type of external declarations is not supported." ) - map.put(EXTENSION_FUNCTION_IN_EXTERNAL_DECLARATION, "Function types with receiver are prohibited in external declarations") + map.put(EXTENSION_FUNCTION_IN_EXTERNAL_DECLARATION, "Function types with receivers are prohibited in external declarations.") map.put( NON_ABSTRACT_MEMBER_OF_EXTERNAL_INTERFACE, - "Only nullable properties of external interfaces are allowed to be non-abstract" + "Only nullable properties of external interfaces are allowed to be non-abstract." ) map.put( NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, - "Annotation ''{0}'' is allowed only on member functions of declaration annotated as ''kotlin.js.native'' or on toplevel extension functions", + "Annotation ''{0}'' is only allowed on member functions of declarations annotated with ''kotlin.js.native'' or on top-level extension functions.", FirDiagnosticRenderers.RENDER_TYPE ) map.put( NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER, - "Native {0}''s first parameter type should be ''kotlin.String'' or subtype of ''kotlin.Number''", + "Native {0}''s first parameter type should be ''kotlin.String'' or a subtype of ''kotlin.Number''.", CommonRenderers.STRING ) - map.put(NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS, "Native {0}''s parameter can not have default value", CommonRenderers.STRING) - map.put(NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE, "Native getter's return type should be nullable") + map.put(NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS, "Native {0}''s parameter cannot have default value.", CommonRenderers.STRING) + map.put(NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE, "Native getter's return type should be nullable.") map.put( NATIVE_SETTER_WRONG_RETURN_TYPE, - "Native setter's return type should be 'Unit' or a supertype of the second parameter's type" + "Native setter's return type should be 'Unit' or a supertype of the second parameter's type." ) map.put( - NATIVE_INDEXER_WRONG_PARAMETER_COUNT, "Expected {0} parameters for native {1}", + NATIVE_INDEXER_WRONG_PARAMETER_COUNT, "Expected {0} parameters for native {1}.", KtDiagnosticRenderers.TO_STRING, CommonRenderers.STRING ) map.put( NON_EXTERNAL_DECLARATION_IN_INAPPROPRIATE_FILE, - "Can''t put non-external declarations in file marked with ''{0}'' annotation", + "Only external declarations are allowed in files marked with ''{0}'' annotation.", FirDiagnosticRenderers.RENDER_TYPE ) map.put( JS_EXTERNAL_INHERITORS_ONLY, - "External {0} can''t be a parent of non-external {1}", + "External ''{0}'' cannot be a parent of non-external ''{1}''.", FirDiagnosticRenderers.RENDER_CLASS_OR_OBJECT_NAME, FirDiagnosticRenderers.RENDER_CLASS_OR_OBJECT_NAME ) map.put( JS_EXTERNAL_ARGUMENT, - "Expected argument with external type, but type ''{0}'' is non-external", + "Expected argument with external type, but type ''{0}'' is non-external.", FirDiagnosticRenderers.RENDER_TYPE ) map.put( EXTERNAL_INTERFACE_AS_REIFIED_TYPE_ARGUMENT, - "Cannot pass external interface {0} for reified type parameter", + "Cannot pass external interface ''{0}'' for reified type parameter.", FirDiagnosticRenderers.RENDER_TYPE ) - map.put(JS_NAME_PROHIBITED_FOR_EXTENSION_PROPERTY, "@JsName is prohibited for extension properties") + map.put(JS_NAME_PROHIBITED_FOR_EXTENSION_PROPERTY, "'@JsName' is prohibited for extension properties.") map.put( JS_BUILTIN_NAME_CLASH, - "JavaScript name generated for this declaration clashes with built-in declaration {0}", + "JavaScript name generated for this declaration clashes with built-in declaration ''{0}''.", CommonRenderers.STRING ) - map.put(NAME_CONTAINS_ILLEGAL_CHARS, "Name contains illegal chars that can't appear in JavaScript identifier") + map.put(NAME_CONTAINS_ILLEGAL_CHARS, "Name contains illegal chars that cannot appear in JavaScript identifier.") - map.put(JS_NAME_IS_NOT_ON_ALL_ACCESSORS, "@JsName should be on all the property accessors") - map.put(JS_NAME_PROHIBITED_FOR_NAMED_NATIVE, "@JsName is prohibited for external declaration with explicit name") - map.put(JS_NAME_PROHIBITED_FOR_OVERRIDE, "@JsName is prohibited for overridden members") - map.put(JS_NAME_ON_PRIMARY_CONSTRUCTOR_PROHIBITED, "@JsName annotation is prohibited for primary constructors") - map.put(JS_NAME_ON_ACCESSOR_AND_PROPERTY, "@JsName can be either on a property or its accessors, not both of them") + map.put(JS_NAME_IS_NOT_ON_ALL_ACCESSORS, "'@JsName' should be on all the property accessors.") + map.put(JS_NAME_PROHIBITED_FOR_NAMED_NATIVE, "'@JsName' is prohibited for external declaration with explicit name.") + map.put(JS_NAME_PROHIBITED_FOR_OVERRIDE, "'@JsName' is prohibited for overridden members.") + map.put(JS_NAME_ON_PRIMARY_CONSTRUCTOR_PROHIBITED, "'@JsName' annotation is prohibited for primary constructors.") + map.put(JS_NAME_ON_ACCESSOR_AND_PROPERTY, "'@JsName' can be either on a property or its accessors, not both of them.") map.put( CANNOT_CHECK_FOR_EXTERNAL_INTERFACE, "Cannot check for external interface: ''{0}''", @@ -214,13 +214,13 @@ object FirJsErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( UNCHECKED_CAST_TO_EXTERNAL_INTERFACE, - "Unchecked cast to external interface: ''{0}'' to ''{1}''", + "Unchecked cast to external interface: ''{0}'' to ''{1}''.", FirDiagnosticRenderers.RENDER_TYPE, FirDiagnosticRenderers.RENDER_TYPE, ) - map.put(EXTERNAL_INTERFACE_AS_CLASS_LITERAL, "Can't refer to external interface from class literal") - map.put(NESTED_JS_EXPORT, "@JsExport is only allowed on files and top-level declarations") - map.put(WRONG_EXPORTED_DECLARATION, "Declaration of such kind ({0}) can''t be exported to JS", CommonRenderers.STRING) + map.put(EXTERNAL_INTERFACE_AS_CLASS_LITERAL, "Cannot refer to external interface from class literal.") + map.put(NESTED_JS_EXPORT, "'@JsExport' is only allowed on files and top-level declarations.") + map.put(WRONG_EXPORTED_DECLARATION, "Declaration of such kind ({0}) cannot be exported to JavaScript.", CommonRenderers.STRING) map.put( NON_EXPORTABLE_TYPE, "Exported declaration uses non-exportable {0} type: ''{1}''", @@ -229,7 +229,7 @@ object FirJsErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( NON_CONSUMABLE_EXPORTED_IDENTIFIER, - "Exported declaration contains non-consumable identifier ''${0}'', that can''t be represented inside TS definitions and ESM", + "Exported declaration contains non-consumable identifier ''{0}'', which cannot be represented inside TS definitions and ESM.", CommonRenderers.STRING, ) } diff --git a/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt b/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt index c7d2032b408..bab9352bbba 100644 --- a/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt +++ b/compiler/fir/checkers/checkers.jvm/src/org/jetbrains/kotlin/fir/analysis/diagnostics/jvm/FirJvmErrorsDefaultMessages.kt @@ -83,124 +83,124 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.jvm.FirJvmErrors.VALUE_CLAS object FirJvmErrorsDefaultMessages : BaseDiagnosticRendererFactory() { override val MAP = KtDiagnosticFactoryToRendererMap("FIR").also { map -> - map.put(CONFLICTING_JVM_DECLARATIONS, "Platform declaration clash") - map.put(JAVA_TYPE_MISMATCH, "Java type mismatch: expected ''{0}'' but found ''{1}''. Use explicit cast", RENDER_TYPE, RENDER_TYPE) - map.put(UPPER_BOUND_CANNOT_BE_ARRAY, "Upper bound of a type parameter cannot be an array") - map.put(STRICTFP_ON_CLASS, "'@Strictfp' annotation on classes is unsupported yet") - map.put(SYNCHRONIZED_ON_ABSTRACT, "'@Synchronized' annotation cannot be used on abstract functions") - map.put(SYNCHRONIZED_ON_INLINE, "'@Synchronized' annotation has no effect on inline functions") - map.put(SYNCHRONIZED_ON_SUSPEND, "@Synchronized annotation is not applicable to suspend functions and lambdas") - map.put(SYNCHRONIZED_IN_INTERFACE, "'@Synchronized' annotation cannot be used on interface members") - map.put(OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS, "'@JvmOverloads' annotation has no effect for methods without default arguments") - map.put(OVERLOADS_ABSTRACT, "'@JvmOverloads' annotation cannot be used on abstract methods") - map.put(OVERLOADS_INTERFACE, "'@JvmOverloads' annotation cannot be used on interface methods") - map.put(OVERLOADS_PRIVATE, "'@JvmOverloads' annotation has no effect on private declarations") - map.put(OVERLOADS_LOCAL, "'@JvmOverloads' annotation cannot be used on local declarations") + map.put(CONFLICTING_JVM_DECLARATIONS, "Platform declaration clash.") + map.put(JAVA_TYPE_MISMATCH, "Java type mismatch: expected ''{0}'' but found ''{1}''. Use explicit cast.", RENDER_TYPE, RENDER_TYPE) + map.put(UPPER_BOUND_CANNOT_BE_ARRAY, "Upper bound of type parameter cannot be an array.") + map.put(STRICTFP_ON_CLASS, "'@Strictfp' annotation on classes is not yet supported.") + map.put(SYNCHRONIZED_ON_ABSTRACT, "'@Synchronized' annotation cannot be used on abstract functions.") + map.put(SYNCHRONIZED_ON_INLINE, "'@Synchronized' annotation has no effect on inline functions.") + map.put(SYNCHRONIZED_ON_SUSPEND, "'@Synchronized' annotation is not applicable to 'suspend' functions and lambdas.") + map.put(SYNCHRONIZED_IN_INTERFACE, "'@Synchronized' annotation cannot be used on interface members.") + map.put(OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS, "'@JvmOverloads' annotation has no effect for methods without default arguments.") + map.put(OVERLOADS_ABSTRACT, "'@JvmOverloads' annotation cannot be used on abstract methods.") + map.put(OVERLOADS_INTERFACE, "'@JvmOverloads' annotation cannot be used on interface methods.") + map.put(OVERLOADS_PRIVATE, "'@JvmOverloads' annotation has no effect on private declarations.") + map.put(OVERLOADS_LOCAL, "'@JvmOverloads' annotation cannot be used on local declarations.") map.put( OVERLOADS_ANNOTATION_CLASS_CONSTRUCTOR, - "'@JvmOverloads' annotation cannot be used on constructors of annotation classes" + "'@JvmOverloads' annotation cannot be used on constructors of annotation classes." ) - map.put(DEPRECATED_JAVA_ANNOTATION, "This annotation is deprecated in Kotlin. Use ''@{0}'' instead", TO_STRING) - map.put(POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION, "Only named arguments are available for Java annotations") - map.put(JVM_PACKAGE_NAME_CANNOT_BE_EMPTY, "'@JvmPackageName' annotation value cannot be empty") + map.put(DEPRECATED_JAVA_ANNOTATION, "This annotation is deprecated in Kotlin. Use ''@{0}'' instead.", TO_STRING) + map.put(POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION, "Only named arguments are available for Java annotations.") + map.put(JVM_PACKAGE_NAME_CANNOT_BE_EMPTY, "'@JvmPackageName' annotation value cannot be empty.") map.put( JVM_PACKAGE_NAME_MUST_BE_VALID_NAME, - "'@JvmPackageName' annotation value must be a valid dot-qualified name of a package" + "'@JvmPackageName' annotation value must be a valid dot-qualified name of a package." ) map.put( JVM_PACKAGE_NAME_NOT_SUPPORTED_IN_FILES_WITH_CLASSES, - "'@JvmPackageName' annotation is not supported for files with class declarations" + "'@JvmPackageName' annotation is not supported for files with class declarations." ) map.put( SUPER_CALL_WITH_DEFAULT_PARAMETERS, - "Super-calls with default arguments are not allowed. Please specify all arguments of ''super.{0}'' explicitly", + "Super-calls with default arguments are prohibited. Please specify all arguments of ''super.{0}'' explicitly.", TO_STRING ) - map.put(LOCAL_JVM_RECORD, "Local @JvmRecord classes are not allowed") - map.put(NON_FINAL_JVM_RECORD, "@JvmRecord class should be final") - map.put(ENUM_JVM_RECORD, "@JvmRecord class should not be an enum") + map.put(LOCAL_JVM_RECORD, "Local '@JvmRecord' classes are prohibited.") + map.put(NON_FINAL_JVM_RECORD, "'@JvmRecord' class should be final.") + map.put(ENUM_JVM_RECORD, "'@JvmRecord' class should not be an enum.") map.put( JVM_RECORD_WITHOUT_PRIMARY_CONSTRUCTOR_PARAMETERS, - "Primary constructor with parameters is required for @JvmRecord class" + "Primary constructor with parameters is required for '@JvmRecord' class." ) - map.put(JVM_RECORD_NOT_VAL_PARAMETER, "Constructor parameter of @JvmRecord class should be a val") - map.put(JVM_RECORD_NOT_LAST_VARARG_PARAMETER, "Only the last constructor parameter of @JvmRecord may be a vararg") - map.put(JVM_RECORD_EXTENDS_CLASS, "Record cannot inherit a class", RENDER_TYPE) - map.put(INNER_JVM_RECORD, "@JvmRecord class should not be inner") - map.put(FIELD_IN_JVM_RECORD, "It's not allowed to have non-constructor properties with backing field in @JvmRecord class") - map.put(DELEGATION_BY_IN_JVM_RECORD, "Delegation is not allowed for @JvmRecord classes") - map.put(NON_DATA_CLASS_JVM_RECORD, "Only data classes are allowed to be marked as @JvmRecord") - map.put(ILLEGAL_JAVA_LANG_RECORD_SUPERTYPE, "Classes cannot have explicit 'java.lang.Record' supertype") + map.put(JVM_RECORD_NOT_VAL_PARAMETER, "Constructor parameter of '@JvmRecord' class should be a 'val'.") + map.put(JVM_RECORD_NOT_LAST_VARARG_PARAMETER, "Only the last constructor parameter of '@JvmRecord' can be a vararg.") + map.put(JVM_RECORD_EXTENDS_CLASS, "Record cannot extend a class.", RENDER_TYPE) + map.put(INNER_JVM_RECORD, "'@JvmRecord' class should not be inner.") + map.put(FIELD_IN_JVM_RECORD, "Non-constructor properties with backing field in '@JvmRecord' class are prohibited.") + map.put(DELEGATION_BY_IN_JVM_RECORD, "Delegation is prohibited for '@JvmRecord' classes.") + map.put(NON_DATA_CLASS_JVM_RECORD, "Only data classes are allowed to be marked as '@JvmRecord'.") + map.put(ILLEGAL_JAVA_LANG_RECORD_SUPERTYPE, "Classes cannot have explicit 'java.lang.Record' supertype.") - map.put(OVERRIDE_CANNOT_BE_STATIC, "Override member cannot be '@JvmStatic' in object") + map.put(OVERRIDE_CANNOT_BE_STATIC, "Override member cannot be '@JvmStatic' in an object.") map.put( JVM_STATIC_NOT_IN_OBJECT_OR_CLASS_COMPANION, - "Only members in named objects and companion objects of classes can be annotated with '@JvmStatic'" + "Only members in named objects and companion objects of classes can be annotated with '@JvmStatic'." ) map.put( JVM_STATIC_NOT_IN_OBJECT_OR_COMPANION, - "Only members in named objects and companion objects can be annotated with '@JvmStatic'" + "Only members in named objects and companion objects can be annotated with '@JvmStatic'." ) map.put( JVM_STATIC_ON_NON_PUBLIC_MEMBER, - "Only public members in interface companion objects can be annotated with '@JvmStatic'" + "Only public members in interface companion objects can be annotated with '@JvmStatic'." ) map.put( JVM_STATIC_ON_CONST_OR_JVM_FIELD, - "'@JvmStatic' annotation is useless for const or '@JvmField' properties", + "'@JvmStatic' annotation is useless for const or '@JvmField' properties.", ) map.put( JVM_STATIC_ON_EXTERNAL_IN_INTERFACE, - "'@JvmStatic' annotation cannot be used on 'external' members of interface companions" + "'@JvmStatic' annotation cannot be used on 'external' members of interface companions." ) - map.put(INAPPLICABLE_JVM_NAME, "'@JvmName' annotation is not applicable to this declaration") - map.put(ILLEGAL_JVM_NAME, "Illegal JVM name") + map.put(INAPPLICABLE_JVM_NAME, "'@JvmName' annotation is not applicable to this declaration.") + map.put(ILLEGAL_JVM_NAME, "Illegal JVM name.") - map.put(FUNCTION_DELEGATE_MEMBER_NAME_CLASH, "Spread operator is prohibited for arguments to signature-polymorphic calls") + map.put(FUNCTION_DELEGATE_MEMBER_NAME_CLASH, "Spread operator is prohibited for arguments to signature-polymorphic calls.") - map.put(VALUE_CLASS_WITHOUT_JVM_INLINE_ANNOTATION, "Value classes without @JvmInline annotation are not supported yet") - map.put(JVM_INLINE_WITHOUT_VALUE_CLASS, "@JvmInline annotation is only applicable to value classes") + map.put(VALUE_CLASS_WITHOUT_JVM_INLINE_ANNOTATION, "Value classes without '@JvmInline' annotation are not yet supported.") + map.put(JVM_INLINE_WITHOUT_VALUE_CLASS, "'@JvmInline' annotation is applicable only to value classes.") - map.put(JVM_DEFAULT_IN_DECLARATION, "Usage of ''@{0}'' is only allowed with -Xjvm-default option", STRING) + map.put(JVM_DEFAULT_IN_DECLARATION, "Usage of ''@{0}'' is only allowed with ''-Xjvm-default'' option.", STRING) map.put( JVM_DEFAULT_WITH_COMPATIBILITY_IN_DECLARATION, - "Usage of '@JvmDefaultWithCompatibility' is only allowed with '-Xjvm-default=all' option" + "Usage of '@JvmDefaultWithCompatibility' is only allowed with '-Xjvm-default=all' option." ) map.put( JVM_DEFAULT_WITH_COMPATIBILITY_NOT_ON_INTERFACE, - "'@JvmDefaultWithCompatibility' annotation is only allowed on interfaces" + "'@JvmDefaultWithCompatibility' annotation is allowed only on interfaces." ) - map.put(EXTERNAL_DECLARATION_IN_INTERFACE, "Members of interfaces can not be external") - map.put(EXTERNAL_DECLARATION_CANNOT_BE_ABSTRACT, "External declaration can not be abstract") - map.put(EXTERNAL_DECLARATION_CANNOT_HAVE_BODY, "External declaration can not have a body") - map.put(EXTERNAL_DECLARATION_CANNOT_BE_INLINED, "Inline functions can not be external") + map.put(EXTERNAL_DECLARATION_IN_INTERFACE, "Members of interfaces cannot be external.") + map.put(EXTERNAL_DECLARATION_CANNOT_BE_ABSTRACT, "External declaration cannot be abstract.") + map.put(EXTERNAL_DECLARATION_CANNOT_HAVE_BODY, "External declaration cannot have a body.") + map.put(EXTERNAL_DECLARATION_CANNOT_BE_INLINED, "Inline functions cannot be external.") - map.put(INAPPLICABLE_JVM_FIELD, "{0}", STRING) - map.put(INAPPLICABLE_JVM_FIELD_WARNING, "{0}. This warning will become an error in further releases", STRING) + map.put(INAPPLICABLE_JVM_FIELD, "{0}.", STRING) + map.put(INAPPLICABLE_JVM_FIELD_WARNING, "{0}. This warning will become an error in future releases.", STRING) - map.put(JVM_SYNTHETIC_ON_DELEGATE, "'@JvmSynthetic' annotation cannot be used on delegated properties") + map.put(JVM_SYNTHETIC_ON_DELEGATE, "'@JvmSynthetic' annotation cannot be used on delegated properties.") map.put( NON_SOURCE_REPEATED_ANNOTATION, - "Repeatable annotations with non-SOURCE retention are only supported starting from Kotlin 1.6" + "Repeatable annotations with non-SOURCE retention are supported only in Kotlin 1.6 and later." ) map.put( REPEATED_ANNOTATION_WITH_CONTAINER, - "Repeated annotation ''@{0}'' cannot be used on a declaration which is annotated with its container annotation ''@{1}''", + "Repeated annotation ''@{0}'' cannot be used on a declaration that is annotated with its container annotation ''@{1}''.", TO_STRING, TO_STRING ) map.put( INTERFACE_CANT_CALL_DEFAULT_METHOD_VIA_SUPER, - "Interfaces can call JVM-default members via super only within JVM-default members. Please use '-Xjvm-default=all/all-compatibility' modes for such calls" + "Interfaces can only call JVM-default members via super within JVM-default members. Please use '-Xjvm-default=all/all-compatibility' modes for such calls." ) map.put( SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC, - "Using protected members which are not @JvmStatic in the superclass companion is unsupported yet" + "Using protected members that are not '@JvmStatic' in the superclass companion is not yet supported." ) map.put( @@ -231,37 +231,37 @@ object FirJvmErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( REPEATABLE_ANNOTATION_HAS_NESTED_CLASS_NAMED_CONTAINER, - "Repeatable annotation cannot have a nested class named 'Container'. This name is reserved for auto-generated container class" + "Repeatable annotation cannot have a nested class named 'Container'. This name is reserved for auto-generated container class." ) map.put( SUSPENSION_POINT_INSIDE_CRITICAL_SECTION, - "The ''{0}'' suspension point is inside a critical section", + "The ''{0}'' suspension point is inside a critical section.", SYMBOL ) map.put( CONCURRENT_HASH_MAP_CONTAINS_OPERATOR, - "Method 'contains' from ConcurrentHashMap may have unexpected semantics: it calls 'containsValue' instead of 'containsKey'. " + - "Use explicit form of the call to 'containsKey'/'containsValue'/'contains' or cast the value to kotlin.collections.Map instead. " + - "See https://youtrack.jetbrains.com/issue/KT-18053 for more details" + "Method 'contains' from ConcurrentHashMap might have unexpected semantics: it calls 'containsValue' instead of 'containsKey'. " + + "Use the explicit form of the call to 'containsKey'/'containsValue'/'contains' or cast the value to 'kotlin.collections.Map' instead. " + + "See https://youtrack.jetbrains.com/issue/KT-18053 for more details." ) map.put( SPREAD_ON_SIGNATURE_POLYMORPHIC_CALL, - "Spread operator is prohibited for arguments to signature-polymorphic calls" + "Spread operator is prohibited for arguments to signature-polymorphic calls." ) map.put( JAVA_SAM_INTERFACE_CONSTRUCTOR_REFERENCE, - "Java SAM interface constructor references are prohibited" + "Java SAM interface constructor references are prohibited." ) map.put( REDUNDANT_REPEATABLE_ANNOTATION, - "Please, remove the ''{0}'' annotation, as ''{1}'' is already enough", + "Please remove the ''{0}'' annotation, as it is redundant in presence of ''{1}''.", TO_STRING, TO_STRING, ) map.put( NO_REFLECTION_IN_CLASS_PATH, "Call uses reflection API which is not found in compilation classpath. " + - "Make sure you have kotlin-reflect.jar in the classpath" + "Make sure you have kotlin-reflect.jar in the classpath." ) } } diff --git a/compiler/fir/checkers/checkers.native/src/org/jetbrains/kotlin/fir/analysis/diagnostics/native/FirNativeErrorsDefaultMessages.kt b/compiler/fir/checkers/checkers.native/src/org/jetbrains/kotlin/fir/analysis/diagnostics/native/FirNativeErrorsDefaultMessages.kt index 7ba0837e141..34a3e010d5a 100644 --- a/compiler/fir/checkers/checkers.native/src/org/jetbrains/kotlin/fir/analysis/diagnostics/native/FirNativeErrorsDefaultMessages.kt +++ b/compiler/fir/checkers/checkers.native/src/org/jetbrains/kotlin/fir/analysis/diagnostics/native/FirNativeErrorsDefaultMessages.kt @@ -42,49 +42,49 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors.UNCH object FirNativeErrorsDefaultMessages : BaseDiagnosticRendererFactory() { override val MAP = KtDiagnosticFactoryToRendererMap("FIR").also { map -> - map.put(THROWS_LIST_EMPTY, "Throws must have non-empty class list") - map.put(INCOMPATIBLE_THROWS_OVERRIDE, "Member overrides different @Throws filter from {0}", SYMBOL) - map.put(INCOMPATIBLE_THROWS_INHERITED, "Member inherits different @Throws filters from {0}", SYMBOLS) + map.put(THROWS_LIST_EMPTY, "Throws must have a non-empty class list.") + map.put(INCOMPATIBLE_THROWS_OVERRIDE, "Member overrides different ''@Throws'' filter from ''{0}''.", SYMBOL) + map.put(INCOMPATIBLE_THROWS_INHERITED, "Member inherits different ''@Throws'' filters from ''{0}''.", SYMBOLS) map.put( - MISSING_EXCEPTION_IN_THROWS_ON_SUSPEND, "@Throws on suspend declaration must have {0} (or any of its superclasses) listed", + MISSING_EXCEPTION_IN_THROWS_ON_SUSPEND, "''@Throws'' on suspend declaration must have ''{0}'' (or any of its superclasses) listed.", TO_STRING ) map.put( INAPPLICABLE_SHARED_IMMUTABLE_PROPERTY, - "@SharedImmutable is applicable only to val with backing field or to property with delegation" + "'@SharedImmutable' is applicable only to 'val' with backing field or to property with delegation." ) - map.put(INAPPLICABLE_SHARED_IMMUTABLE_TOP_LEVEL, "@SharedImmutable is applicable only to top level declarations") + map.put(INAPPLICABLE_SHARED_IMMUTABLE_TOP_LEVEL, "'@SharedImmutable' is applicable only to top-level declarations.") map.put( INAPPLICABLE_THREAD_LOCAL, - "@ThreadLocal is applicable only to property with backing field, to property with delegation or to objects" + "'@ThreadLocal' is applicable only to property with backing field, to property with delegation, or to objects." ) - map.put(INAPPLICABLE_THREAD_LOCAL_TOP_LEVEL, "@ThreadLocal is applicable only to top level declarations") - map.put(INVALID_CHARACTERS_NATIVE, "Name {0}", TO_STRING) - map.put(REDUNDANT_SWIFT_REFINEMENT, "An ObjC refined declaration can't also be refined in Swift") + map.put(INAPPLICABLE_THREAD_LOCAL_TOP_LEVEL, "'@ThreadLocal' is applicable only to top-level declarations.") + map.put(INVALID_CHARACTERS_NATIVE, "Name {0}.", TO_STRING) + map.put(REDUNDANT_SWIFT_REFINEMENT, "ObjC refined declarations cannot be refined in Swift.") map.put( INCOMPATIBLE_OBJC_REFINEMENT_OVERRIDE, - "Refined declaration \"{0}\" overrides declarations with different or no refinement from {1}", + "Refined declaration ''{0}'' overrides declarations with different or no refinement from ''{1}''.", SYMBOL, SYMBOLS ) map.put( INVALID_OBJC_HIDES_TARGETS, - "@HidesFromObjC annotation is only applicable to annotations with targets CLASS, FUNCTION and/or PROPERTY" + "'@HidesFromObjC' annotation is only applicable to annotations with targets CLASS, FUNCTION, and/or PROPERTY." ) map.put( INVALID_REFINES_IN_SWIFT_TARGETS, - "@RefinesInSwift annotation is only applicable to annotations with targets FUNCTION and/or PROPERTY" + "'@RefinesInSwift' annotation is only applicable to annotations with targets FUNCTION and/or PROPERTY." ) - map.put(INAPPLICABLE_OBJC_NAME, "@ObjCName is not applicable on overrides") - map.put(INVALID_OBJC_NAME, "@ObjCName should have a name and/or swiftName") - map.put(EMPTY_OBJC_NAME, "Empty @ObjCName names aren't supported") - map.put(INVALID_OBJC_NAME_CHARS, "@ObjCName contains illegal characters: {0}", TO_STRING) - map.put(INVALID_OBJC_NAME_FIRST_CHAR, "@ObjCName contains illegal first characters: {0}", TO_STRING) - map.put(INCOMPATIBLE_OBJC_NAME_OVERRIDE, "Member \"{0}\" inherits inconsistent @ObjCName from {1}", SYMBOL, SYMBOLS) - map.put(INAPPLICABLE_EXACT_OBJC_NAME, "Exact @ObjCName is only applicable to classes, objects and interfaces") - map.put(MISSING_EXACT_OBJC_NAME, "Exact @ObjCName is required to have an ObjC name") - map.put(NON_LITERAL_OBJC_NAME_ARG, "@ObjCName accepts only literal string and boolean values") - map.put(SUBTYPE_OF_HIDDEN_FROM_OBJC, "Only @HiddenFromObjC declaration can be a subtype of @HiddenFromObjC declaration") + map.put(INAPPLICABLE_OBJC_NAME, "'@ObjCName' is not applicable to overrides.") + map.put(INVALID_OBJC_NAME, "'@ObjCName' should have a name and/or swiftName.") + map.put(EMPTY_OBJC_NAME, "Empty '@ObjCName' names aren't supported.") + map.put(INVALID_OBJC_NAME_CHARS, "''@ObjCName'' contains illegal characters ''{0}''.", TO_STRING) + map.put(INVALID_OBJC_NAME_FIRST_CHAR, "''@ObjCName'' contains illegal first characters ''{0}''.", TO_STRING) + map.put(INCOMPATIBLE_OBJC_NAME_OVERRIDE, "Member ''{0}'' inherits inconsistent ''@ObjCName'' from ''{1}''.", SYMBOL, SYMBOLS) + map.put(INAPPLICABLE_EXACT_OBJC_NAME, "Exact '@ObjCName' is only applicable to classes, objects, and interfaces.") + map.put(MISSING_EXACT_OBJC_NAME, "Exact '@ObjCName' is required to have an ObjC name.") + map.put(NON_LITERAL_OBJC_NAME_ARG, "'@ObjCName' accepts only literal 'String' and 'Boolean' values.") + map.put(SUBTYPE_OF_HIDDEN_FROM_OBJC, "Only '@HiddenFromObjC' declaration can be a subtype of '@HiddenFromObjC' declaration.") map.put( @@ -100,12 +100,12 @@ object FirNativeErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( FORWARD_DECLARATION_AS_REIFIED_TYPE_ARGUMENT, - "Cannot pass forward declaration ''{0}'' for reified type parameter", + "Cannot pass forward declaration ''{0}'' for reified type parameter.", FirDiagnosticRenderers.RENDER_TYPE ) map.put( FORWARD_DECLARATION_AS_CLASS_LITERAL, - "Can't refer to forward declaration ''{0}'' from class literal", + "Cannot refer to forward declaration ''{0}'' from class literal.", FirDiagnosticRenderers.RENDER_TYPE ) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirContractChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirContractChecker.kt index 3aa2e04ab91..fc2afa1f977 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirContractChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/declaration/FirContractChecker.kt @@ -62,10 +62,10 @@ object FirContractChecker : FirFunctionChecker() { fun contractNotAllowed(message: String) = reporter.reportOn(source, FirErrors.CONTRACT_NOT_ALLOWED, message, context) - if (declaration is FirPropertyAccessor || declaration is FirAnonymousFunction) contractNotAllowed("Contracts are only allowed for functions") - else if (declaration.isAbstract || declaration.isOpen || declaration.isOverride) contractNotAllowed("Contracts are not allowed for open or override functions") - else if (declaration.isOperator) contractNotAllowed("Contracts are not allowed for operator functions") - else if (declaration.symbol.callableId.isLocal || declaration.visibility == Visibilities.Local) contractNotAllowed("Contracts are not allowed for local functions") + if (declaration is FirPropertyAccessor || declaration is FirAnonymousFunction) contractNotAllowed("Contracts are only allowed for functions.") + else if (declaration.isAbstract || declaration.isOpen || declaration.isOverride) contractNotAllowed("Contracts are not allowed for open or override functions.") + else if (declaration.isOperator) contractNotAllowed("Contracts are not allowed for operator functions.") + else if (declaration.symbol.callableId.isLocal || declaration.visibility == Visibilities.Local) contractNotAllowed("Contracts are not allowed for local functions.") } private object DiagnosticExtractor : KtContractDescriptionVisitor() { diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirContractNotFirstStatementChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirContractNotFirstStatementChecker.kt index df9512d17c8..378bb3e2fe0 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirContractNotFirstStatementChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirContractNotFirstStatementChecker.kt @@ -23,9 +23,9 @@ object FirContractNotFirstStatementChecker : FirFunctionCallChecker() { val containingDeclaration = context.containingDeclarations.last() if (!(containingDeclaration is FirFunction && expression.isCorrectlyPlacedIn(containingDeclaration))) { val message = if (containingDeclaration is FirFunction && containingDeclaration.body is FirSingleExpressionBlock) { - "Contracts are only allowed in function body blocks" + "Contracts are only allowed in function body blocks." } else { - "Contract should be the first statement" + "Contract should be the first statement." } reporter.reportOn(expression.source, FirErrors.CONTRACT_NOT_ALLOWED, message, context) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt index a795ba51f6f..c68380ecc16 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt @@ -161,7 +161,7 @@ object FirDiagnosticRenderers { } val MODULE_DATA = Renderer { - "Module ${it.name}" + "module ${it.name}" } val NAME_OF_CONTAINING_DECLARATION_OR_FILE = Renderer { symbol: CallableId -> diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrorsDefaultMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrorsDefaultMessages.kt index df1fda49934..b9f8ef5e2cf 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrorsDefaultMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrorsDefaultMessages.kt @@ -693,293 +693,293 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { // # - The new diagnostic differs from the old FE's one override val MAP = KtDiagnosticFactoryToRendererMap("FIR").also { map -> // Meta-errors - map.put(UNSUPPORTED, "Unsupported [{0}]", TO_STRING) + map.put(UNSUPPORTED, "Unsupported [{0}].", TO_STRING) map.put(UNSUPPORTED_FEATURE, "{0}", LanguageFeatureMessageRenderer(LanguageFeatureMessageRenderer.Type.UNSUPPORTED)) - map.put(UNSUPPORTED_SUSPEND_TEST, "'suspend' functions annotated with @kotlin.test.Test are unsupported") - map.put(NEW_INFERENCE_ERROR, "New inference error [{0}]", STRING) + map.put(UNSUPPORTED_SUSPEND_TEST, "'suspend' functions annotated with '@kotlin.test.Test' are unsupported.") + map.put(NEW_INFERENCE_ERROR, "New inference error [{0}].", STRING) // Miscellaneous - map.put(OTHER_ERROR, "Unknown (other) error") + map.put(OTHER_ERROR, "Unknown error.") // General syntax - map.put(ILLEGAL_CONST_EXPRESSION, "Illegal const expression") - map.put(ILLEGAL_UNDERSCORE, "Illegal underscore") + map.put(ILLEGAL_CONST_EXPRESSION, "Incorrect const expression.") + map.put(ILLEGAL_UNDERSCORE, "Incorrect usage of underscore in numeric literal.") // map.put(EXPRESSION_REQUIRED, ...) // & - map.put(BREAK_OR_CONTINUE_OUTSIDE_A_LOOP, "'break' and 'continue' are only allowed inside a loop") - map.put(NOT_A_LOOP_LABEL, "The label does not denote a loop") // * - map.put(BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY, "'break' or 'continue' jumps across a function or a class boundary") - map.put(VARIABLE_EXPECTED, "Variable expected") - map.put(DELEGATION_IN_INTERFACE, "Interfaces cannot use delegation") - map.put(DELEGATION_NOT_TO_INTERFACE, "Only interfaces can be delegated to") + map.put(BREAK_OR_CONTINUE_OUTSIDE_A_LOOP, "'break' and 'continue' are only allowed inside loops.") + map.put(NOT_A_LOOP_LABEL, "Label does not denote a loop.") // * + map.put(BREAK_OR_CONTINUE_JUMPS_ACROSS_FUNCTION_BOUNDARY, "'break' or 'continue' crosses a function or class boundary.") + map.put(VARIABLE_EXPECTED, "Variable expected.") + map.put(DELEGATION_IN_INTERFACE, "Delegation cannot be used in interfaces.") + map.put(DELEGATION_NOT_TO_INTERFACE, "Delegation is supported only for interfaces.") map.put( DELEGATED_MEMBER_HIDES_SUPERTYPE_OVERRIDE, - "Delegated member ''{0}'' hides supertype override: {1}. Please specify proper override explicitly", SYMBOL, SYMBOL + "Delegated member ''{0}'' hides supertype override ''{1}''. Please specify proper override explicitly.", SYMBOL, SYMBOL ) - map.put(NESTED_CLASS_NOT_ALLOWED, "{0} is not allowed here", TO_STRING) - map.put(VAL_OR_VAR_ON_LOOP_PARAMETER, "''{0}'' on loop parameter is not allowed", TO_STRING) - map.put(VAL_OR_VAR_ON_FUN_PARAMETER, "''{0}'' on function parameter is not allowed", TO_STRING) - map.put(VAL_OR_VAR_ON_CATCH_PARAMETER, "''{0}'' on catch parameter is not allowed", TO_STRING) - map.put(VAL_OR_VAR_ON_SECONDARY_CONSTRUCTOR_PARAMETER, "''{0}'' on secondary constructor parameter is not allowed", TO_STRING) - map.put(DEPRECATION, "''{0}'' is deprecated. {1}", SYMBOL, STRING) - map.put(DEPRECATION_ERROR, "''{0}'' is deprecated. {1}", SYMBOL, STRING) + map.put(NESTED_CLASS_NOT_ALLOWED, "''{0}'' is prohibited here.", TO_STRING) + map.put(VAL_OR_VAR_ON_LOOP_PARAMETER, "''{0}'' on loop parameter is prohibited.", TO_STRING) + map.put(VAL_OR_VAR_ON_FUN_PARAMETER, "''{0}'' on function parameter is prohibited.", TO_STRING) + map.put(VAL_OR_VAR_ON_CATCH_PARAMETER, "''{0}'' on catch parameter is prohibited.", TO_STRING) + map.put(VAL_OR_VAR_ON_SECONDARY_CONSTRUCTOR_PARAMETER, "''{0}'' on secondary constructor parameter is prohibited.", TO_STRING) + map.put(DEPRECATION, "''{0}'' is deprecated. {1}.", SYMBOL, STRING) + map.put(DEPRECATION_ERROR, "''{0}'' is deprecated. {1}.", SYMBOL, STRING) map.put(VERSION_REQUIREMENT_DEPRECATION, "''{0}''{1} should not be used in Kotlin {2}.{3}", SYMBOL, REQUIRE_KOTLIN_VERSION, STRING, OPTIONAL_SENTENCE) map.put(VERSION_REQUIREMENT_DEPRECATION_ERROR, "''{0}''{1} cannot be used in Kotlin {2}.{3}", SYMBOL, REQUIRE_KOTLIN_VERSION, STRING, OPTIONAL_SENTENCE) - map.put(TYPEALIAS_EXPANSION_DEPRECATION, "''{0}'' uses ''{1}'', which is deprecated. {2}", SYMBOL, SYMBOL, STRING) - map.put(TYPEALIAS_EXPANSION_DEPRECATION_ERROR, "''{0}'' uses ''{1}'', which is an error. {2}", SYMBOL, SYMBOL, STRING) + map.put(TYPEALIAS_EXPANSION_DEPRECATION, "''{0}'' uses ''{1}'', which is deprecated. {2}.", SYMBOL, SYMBOL, STRING) + map.put(TYPEALIAS_EXPANSION_DEPRECATION_ERROR, "''{0}'' uses ''{1}'', which is an error. {2}.", SYMBOL, SYMBOL, STRING) map.put( API_NOT_AVAILABLE, - "This declaration is only available since Kotlin {0} and cannot be used with the specified API version {1}", + "This declaration is only available in Kotlin {0} and newer versions and cannot be used with the specified API version {1}.", TO_STRING, TO_STRING, ) - map.put(ASSIGNMENT_IN_EXPRESSION_CONTEXT, "Assignments are not expressions, and only expressions are allowed in this context") - map.put(EXPRESSION_EXPECTED, "Only expressions are allowed here") + map.put(ASSIGNMENT_IN_EXPRESSION_CONTEXT, "Only expressions are allowed in this context.") + map.put(EXPRESSION_EXPECTED, "Only expressions are allowed here.") - map.put(DIVISION_BY_ZERO, "Division by zero") - map.put(INT_LITERAL_OUT_OF_RANGE, "The value is out of range") - map.put(WRONG_LONG_SUFFIX, "Use 'L' instead of 'l'") - map.put(EMPTY_CHARACTER_LITERAL, "Empty character literal") - map.put(FLOAT_LITERAL_OUT_OF_RANGE, "The value is out of range") + map.put(DIVISION_BY_ZERO, "Division by zero.") + map.put(INT_LITERAL_OUT_OF_RANGE, "Value out of range.") + map.put(WRONG_LONG_SUFFIX, "Use 'L' instead of 'l'.") + map.put(EMPTY_CHARACTER_LITERAL, "Empty character literal.") + map.put(FLOAT_LITERAL_OUT_OF_RANGE, "Value out of range.") map.put( UNSIGNED_LITERAL_WITHOUT_DECLARATIONS_ON_CLASSPATH, - "Type of the constant expression cannot be resolved. Please make sure you have the required dependencies for unsigned types in the classpath" + "Type of constant expression cannot be resolved. Please make sure you have the required dependencies for unsigned types in the classpath." ) - map.put(INCORRECT_CHARACTER_LITERAL, "Incorrect character literal") - map.put(TOO_MANY_CHARACTERS_IN_CHARACTER_LITERAL, "Too many characters in a character literal") - map.put(ILLEGAL_ESCAPE, "Illegal escape") - map.put(NULL_FOR_NONNULL_TYPE, "Null can not be a value of a non-null type ''{0}''", RENDER_TYPE) + map.put(INCORRECT_CHARACTER_LITERAL, "Incorrect character literal.") + map.put(TOO_MANY_CHARACTERS_IN_CHARACTER_LITERAL, "Too many characters in a character literal.") + map.put(ILLEGAL_ESCAPE, "Unsupported escape sequence.") + map.put(NULL_FOR_NONNULL_TYPE, "Null cannot be a value of a non-null type ''{0}''.", RENDER_TYPE) // Unresolved - map.put(INVISIBLE_REFERENCE, "Cannot access ''{0}'': it is {1} in {2}", SYMBOL, VISIBILITY, NAME_OF_DECLARATION_OR_FILE) + map.put(INVISIBLE_REFERENCE, "Cannot access ''{0}'': it is {1} in {2}.", SYMBOL, VISIBILITY, NAME_OF_DECLARATION_OR_FILE) map.put( INVISIBLE_SETTER, - "Cannot access ''{0}'': it is {1} in {2}", + "Cannot access ''{0}'': it is {1} in {2}.", VARIABLE_NAME, VISIBILITY, NAME_OF_CONTAINING_DECLARATION_OR_FILE ) - map.put(INNER_ON_TOP_LEVEL_SCRIPT_CLASS, "Top level script class cannot be inner.") + map.put(INNER_ON_TOP_LEVEL_SCRIPT_CLASS, "Top-level script class cannot be inner.") map.put( ERROR_SUPPRESSION, "This code uses error suppression for ''{0}''. While it might compile and work, the compiler behavior is UNSPECIFIED and WON''T BE PRESERVED. Please report your use case to the Kotlin issue tracker instead: https://kotl.in/issue", TO_STRING ) - map.put(UNRESOLVED_REFERENCE, "Unresolved reference: {0}", NULLABLE_STRING) - map.put(UNRESOLVED_IMPORT, "Unresolved reference: {0}", NULLABLE_STRING) // & - map.put(UNRESOLVED_LABEL, "Unresolved label") - map.put(DESERIALIZATION_ERROR, "Deserialization error") - map.put(ERROR_FROM_JAVA_RESOLUTION, "Java resolution error") + map.put(UNRESOLVED_REFERENCE, "Unresolved reference ''{0}''.", NULLABLE_STRING) + map.put(UNRESOLVED_IMPORT, "Unresolved reference ''{0}''.", NULLABLE_STRING) // & + map.put(UNRESOLVED_LABEL, "Unresolved label.") + map.put(DESERIALIZATION_ERROR, "Deserialization error.") + map.put(ERROR_FROM_JAVA_RESOLUTION, "Java resolution error.") // map.put(UNKNOWN_CALLABLE_KIND, ...) // & - map.put(MISSING_STDLIB_CLASS, "Missing stdlib class") - map.put(NO_THIS, "'this' is not defined in this context") + map.put(MISSING_STDLIB_CLASS, "Missing stdlib class.") + map.put(NO_THIS, "'this' is not defined in this context.") // Super - map.put(SUPER_IS_NOT_AN_EXPRESSION, "Super cannot be a callee") - map.put(SUPER_NOT_AVAILABLE, "No supertypes are accessible in this context") - map.put(ABSTRACT_SUPER_CALL, "Abstract member cannot be accessed directly") + map.put(SUPER_IS_NOT_AN_EXPRESSION, "'super' cannot be a callee.") + map.put(SUPER_NOT_AVAILABLE, "No supertypes are accessible in this context.") + map.put(ABSTRACT_SUPER_CALL, "Abstract member cannot be accessed directly.") map.put( ABSTRACT_SUPER_CALL_WARNING, - "Abstract fake override member access is deprecated. See https://youtrack.jetbrains.com/issue/KT-49017" + "Access to abstract fake override member is deprecated. See https://youtrack.jetbrains.com/issue/KT-49017." ) map.put( INSTANCE_ACCESS_BEFORE_SUPER_CALL, - "Cannot access ''{0}'' before the instance has been initialized", + "Cannot access ''{0}'' before the instance has been initialized.", TO_STRING ) - map.put(CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS, "Cannot create an instance of an abstract class") + map.put(CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS, "Cannot create an instance of an abstract class.") map.put(NO_CONSTRUCTOR, "This type does not have a constructor.") - map.put(FUNCTION_CALL_EXPECTED, "Function invocation ''{0}({1})'' expected", TO_STRING, FUNCTION_PARAMETERS) + map.put(FUNCTION_CALL_EXPECTED, "Function invocation ''{0}({1})'' expected.", TO_STRING, FUNCTION_PARAMETERS) map.put( FUNCTION_EXPECTED, - "Expression ''{0}'' of type ''{1}'' cannot be invoked as a function. The function ''invoke()'' is not found", TO_STRING, RENDER_TYPE + "Expression ''{0}'' of type ''{1}'' cannot be invoked as a function. Function ''invoke()'' is not found.", TO_STRING, RENDER_TYPE ) map.put(INTERFACE_AS_FUNCTION, "Interface ''{0}'' does not have constructors.", SYMBOL) map.put(EXPECT_CLASS_AS_FUNCTION, "Expected class ''{0}'' does not have default constructor.", SYMBOL) map.put( INNER_CLASS_CONSTRUCTOR_NO_RECEIVER, - "Constructor of the inner class ''{0}'' can only be called with a receiver of the containing class", + "Constructor of the inner class ''{0}'' can only be called with a receiver of the containing class.", SYMBOL ) map.put(RESOLUTION_TO_CLASSIFIER, "Resolution to the classifier ''{0}'' is not appropriate here.", SYMBOL) map.put( AMBIGUOUS_ALTERED_ASSIGN, - "Multiple extensions tried to alter this assignment at the same time. Extensions: {0}", + "Multiple extensions attempted to alter this assignment at the same time. Extensions: {0}", COLLECTION(NULLABLE_STRING) ) - map.put(DEPRECATED_BINARY_MOD, "Convention for ''{0}'' is forbidden. Use ''{1}''", SYMBOL, STRING) - map.put(FORBIDDEN_BINARY_MOD, "Deprecated convention for ''{0}''. Use ''{1}''", SYMBOL, STRING) + map.put(DEPRECATED_BINARY_MOD, "Convention for ''{0}'' is prohibited. Use ''{1}''.", SYMBOL, STRING) + map.put(FORBIDDEN_BINARY_MOD, "Deprecated convention for ''{0}''. Use ''{1}''.", SYMBOL, STRING) - map.put(ILLEGAL_SELECTOR, "The expression cannot be a selector (occur after a dot)") - map.put(NO_RECEIVER_ALLOWED, "No receiver can be passed to this function or property") + map.put(ILLEGAL_SELECTOR, "The expression cannot be a selector (cannot occur after a dot).") + map.put(NO_RECEIVER_ALLOWED, "No receiver can be passed to this function or property.") // Supertypes - map.put(NOT_A_SUPERTYPE, "Not an immediate supertype") - map.put(TYPE_ARGUMENTS_REDUNDANT_IN_SUPER_QUALIFIER, "Type arguments do not need to be specified in a 'super' qualifier") - map.put(SUPERCLASS_NOT_ACCESSIBLE_FROM_INTERFACE, "Superclass is not accessible from interface") + map.put(NOT_A_SUPERTYPE, "Not an immediate supertype.") + map.put(TYPE_ARGUMENTS_REDUNDANT_IN_SUPER_QUALIFIER, "Type arguments do not need to be specified in a 'super' qualifier.") + map.put(SUPERCLASS_NOT_ACCESSIBLE_FROM_INTERFACE, "Superclass is not accessible from interface.") map.put( QUALIFIED_SUPERTYPE_EXTENDED_BY_OTHER_SUPERTYPE, - "Explicitly qualified supertype is extended by another supertype ''{0}''", + "Explicitly qualified supertype is extended by supertype ''{0}''.", SYMBOL ) - map.put(SUPERTYPE_INITIALIZED_IN_INTERFACE, "Interfaces cannot initialize supertypes") - map.put(INTERFACE_WITH_SUPERCLASS, "An interface cannot inherit from a class") - map.put(FINAL_SUPERTYPE, "This type is final, so it cannot be inherited from") - map.put(CLASS_CANNOT_BE_EXTENDED_DIRECTLY, "Class {0} cannot be extended directly", SYMBOL) - map.put(SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE, "Extension function type is not allowed as supertypes") - map.put(SINGLETON_IN_SUPERTYPE, "Cannot inherit from a singleton") - map.put(NULLABLE_SUPERTYPE, "A supertype cannot be nullable") - map.put(REDUNDANT_NULLABLE, "Redundant '?'") - map.put(PLATFORM_CLASS_MAPPED_TO_KOTLIN, "This class shouldn''t be used in Kotlin. Use {0} instead.", TO_STRING) - map.put(MANY_CLASSES_IN_SUPERTYPE_LIST, "Only one class may appear in a supertype list") - map.put(SUPERTYPE_APPEARS_TWICE, "A supertype appears twice") - map.put(CLASS_IN_SUPERTYPE_FOR_ENUM, "Enum class cannot inherit from classes") - map.put(SEALED_SUPERTYPE, "This type is sealed, so it can only be inherited by its own nested classes or objects") - map.put(SEALED_SUPERTYPE_IN_LOCAL_CLASS, "{0} cannot extend a sealed {1}", STRING, CLASS_KIND) + map.put(SUPERTYPE_INITIALIZED_IN_INTERFACE, "Interfaces cannot initialize supertypes.") + map.put(INTERFACE_WITH_SUPERCLASS, "An interface cannot extend a class.") + map.put(FINAL_SUPERTYPE, "This type is final, so it cannot be extended.") + map.put(CLASS_CANNOT_BE_EXTENDED_DIRECTLY, "Class ''{0}'' cannot be extended directly.", SYMBOL) + map.put(SUPERTYPE_IS_EXTENSION_FUNCTION_TYPE, "Extension function type is not allowed as a supertype.") + map.put(SINGLETON_IN_SUPERTYPE, "Cannot extend an object.") + map.put(NULLABLE_SUPERTYPE, "Supertypes cannot be nullable.") + map.put(REDUNDANT_NULLABLE, "Redundant '?'.") + map.put(PLATFORM_CLASS_MAPPED_TO_KOTLIN, "This class is not recommended for use in Kotlin. Use ''{0}'' instead.", TO_STRING) + map.put(MANY_CLASSES_IN_SUPERTYPE_LIST, "Only one class can appear in a supertype list.") + map.put(SUPERTYPE_APPEARS_TWICE, "A supertype appears twice.") + map.put(CLASS_IN_SUPERTYPE_FOR_ENUM, "Enum classes cannot extend classes.") + map.put(SEALED_SUPERTYPE, "This type is sealed. It can only be extended by classes or objects in the same package.") + map.put(SEALED_SUPERTYPE_IN_LOCAL_CLASS, "''{0}'' cannot extend a sealed {1}.", STRING, CLASS_KIND) map.put( SEALED_INHERITOR_IN_DIFFERENT_PACKAGE, - "A class can only inherit from a sealed class or interface declared in the same package" + "A class can only extend a sealed class or interface declared in the same package." ) - map.put(SEALED_INHERITOR_IN_DIFFERENT_MODULE, "Inheritance of sealed classes or interfaces from different module is prohibited") - map.put(CLASS_INHERITS_JAVA_SEALED_CLASS, "Inheritance of Java sealed classes is prohibited") - map.put(UNSUPPORTED_SEALED_FUN_INTERFACE, "'sealed fun interface' is unsupported") + map.put(SEALED_INHERITOR_IN_DIFFERENT_MODULE, "Extending sealed classes or interfaces from a different module is prohibited.") + map.put(CLASS_INHERITS_JAVA_SEALED_CLASS, "Extending Java sealed classes is prohibited.") + map.put(UNSUPPORTED_SEALED_FUN_INTERFACE, "'sealed fun interface' is unsupported.") - map.put(SUPERTYPE_NOT_A_CLASS_OR_INTERFACE, "Supertype is not a class or interface", TO_STRING) + map.put(SUPERTYPE_NOT_A_CLASS_OR_INTERFACE, "Supertype is not a class or interface.", TO_STRING) map.put( UNSUPPORTED_INHERITANCE_FROM_JAVA_MEMBER_REFERENCING_KOTLIN_FUNCTION, - "Inheritance of a Java member referencing 'kotlin.jvm.functions.FunctionN': {0} is unsupported", - TO_STRING, + "Inheritance of a Java member referencing ''kotlin.jvm.functions.FunctionN'': {0} is unsupported.", + SYMBOL, ) - map.put(CYCLIC_INHERITANCE_HIERARCHY, "There's a cycle in the inheritance hierarchy for this type") + map.put(CYCLIC_INHERITANCE_HIERARCHY, "Cycle formed in the inheritance hierarchy of this type.") map.put( EXPANDED_TYPE_CANNOT_BE_INHERITED, - "Type alias expands to ''{0}'', which is not a class, an interface, or an object", + "Type alias expands to ''{0}'', which is not a class, interface, or object.", RENDER_TYPE ) - map.put(PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE, "Projections are not allowed for immediate arguments of a supertype") + map.put(PROJECTION_IN_IMMEDIATE_ARGUMENT_TO_SUPERTYPE, "Projections for immediate arguments of a supertype are prohibited.") map.put( INCONSISTENT_TYPE_PARAMETER_VALUES, - "Type parameter {0} of ''{1}'' has inconsistent values: {2}", + "Type parameter ''{0}'' of ''{1}'' has inconsistent values: {2}.", SYMBOL, SYMBOL, RENDER_COLLECTION_OF_TYPES ) map.put( INCONSISTENT_TYPE_PARAMETER_BOUNDS, - "Type parameter {0} of ''{1}'' has inconsistent bounds: {2}", + "Type parameter ''{0}'' of ''{1}'' has inconsistent bounds: {2}.", SYMBOL, SYMBOL, RENDER_COLLECTION_OF_TYPES ) map.put( AMBIGUOUS_SUPER, - "Many supertypes available, please specify the one you mean in angle brackets, e.g. ''super''", + "Multiple supertypes available. Please specify the intended supertype in angle brackets, e.g. ''super''.", NOT_RENDERED ) // Constructor problems - map.put(CONSTRUCTOR_IN_OBJECT, "Constructors are not allowed for objects") - map.put(CONSTRUCTOR_IN_INTERFACE, "An interface may not have a constructor") - map.put(NON_PRIVATE_CONSTRUCTOR_IN_ENUM, "Constructor must be private in enum class") - map.put(NON_PRIVATE_OR_PROTECTED_CONSTRUCTOR_IN_SEALED, "Constructor must be private or protected in sealed class") - map.put(CYCLIC_CONSTRUCTOR_DELEGATION_CALL, "There's a cycle in the delegation calls chain") - map.put(PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED, "Primary constructor call expected") - map.put(PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL, "Protected constructor ''{0}'' from other classes can only be used in super-call", SYMBOL) - map.put(SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR, "Supertype initialization is impossible without primary constructor") - map.put(DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR, "Call to super is not allowed in enum constructor") - map.put(PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS, "Primary constructor required for data class") + map.put(CONSTRUCTOR_IN_OBJECT, "Objects cannot have constructors.") + map.put(CONSTRUCTOR_IN_INTERFACE, "Interfaces cannot have constructors.") + map.put(NON_PRIVATE_CONSTRUCTOR_IN_ENUM, "Constructor must be private in enum class.") + map.put(NON_PRIVATE_OR_PROTECTED_CONSTRUCTOR_IN_SEALED, "Constructor must be private or protected in sealed class.") + map.put(CYCLIC_CONSTRUCTOR_DELEGATION_CALL, "There's a cycle in the delegation calls chain.") + map.put(PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED, "Primary constructor call expected.") + map.put(PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL, "Protected constructor ''{0}'' from other classes can only be used in super-call.", SYMBOL) + map.put(SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR, "Supertype initialization is impossible without a primary constructor.") + map.put(DELEGATION_SUPER_CALL_IN_ENUM_CONSTRUCTOR, "Calls to super in enum constructors are prohibited.") + map.put(PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS, "Primary constructor required for data class.") map.put( EXPLICIT_DELEGATION_CALL_REQUIRED, - "Explicit 'this' or 'super' call is required. There is no constructor in superclass that can be called without arguments" + "Explicit 'this' or 'super' call is required. There is no constructor in the superclass that can be called without arguments." ) - map.put(SEALED_CLASS_CONSTRUCTOR_CALL, "Sealed types cannot be instantiated") - map.put(DATA_CLASS_WITHOUT_PARAMETERS, "Data class must have at least one primary constructor parameter") - map.put(DATA_CLASS_VARARG_PARAMETER, "Primary constructor vararg parameters are forbidden for data classes") - map.put(DATA_CLASS_NOT_PROPERTY_PARAMETER, "Data class primary constructor must only have property (val / var) parameters") + map.put(SEALED_CLASS_CONSTRUCTOR_CALL, "Sealed types cannot be instantiated.") + map.put(DATA_CLASS_WITHOUT_PARAMETERS, "Data class must have at least one primary constructor parameter.") + map.put(DATA_CLASS_VARARG_PARAMETER, "Primary constructor vararg parameters are prohibited for data classes.") + map.put(DATA_CLASS_NOT_PROPERTY_PARAMETER, "Primary constructor of data class must only have property ('val' / 'var') parameters.") // Annotations - map.put(ANNOTATION_USED_AS_ANNOTATION_ARGUMENT, "An annotation can't be used as an annotation argument") - map.put(ANNOTATION_CLASS_MEMBER, "Members are not allowed in annotation class") - map.put(ANNOTATION_ARGUMENT_MUST_BE_CONST, "An annotation argument must be a compile-time constant") - map.put(ANNOTATION_ARGUMENT_MUST_BE_ENUM_CONST, "An enum annotation argument must be an enum constant") - map.put(ANNOTATION_ARGUMENT_MUST_BE_KCLASS_LITERAL, "An annotation argument must be a class literal (T::class)") + map.put(ANNOTATION_USED_AS_ANNOTATION_ARGUMENT, "Annotations cannot be used as annotation arguments.") + map.put(ANNOTATION_CLASS_MEMBER, "Members are prohibited in annotation classes.") + map.put(ANNOTATION_ARGUMENT_MUST_BE_CONST, "Annotation argument must be a compile-time constant.") + map.put(ANNOTATION_ARGUMENT_MUST_BE_ENUM_CONST, "Enum annotation argument must be an enum constant.") + map.put(ANNOTATION_ARGUMENT_MUST_BE_KCLASS_LITERAL, "Annotation argument must be class literal (T::class).") map.put( ANNOTATION_ARGUMENT_KCLASS_LITERAL_OF_TYPE_PARAMETER_ERROR, - "Type parameter in a class literal is deprecated in an annotation argument" + "Type parameter in class literal is deprecated in an annotation argument." ) map.put( ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT, - "Default value of annotation parameter must be a compile-time constant" + "Default value of annotation parameter must be a compile-time constant." ) - map.put(LOCAL_ANNOTATION_CLASS_ERROR, "Annotation class cannot be local") - map.put(MISSING_VAL_ON_ANNOTATION_PARAMETER, "'val' keyword is missing on annotation parameter") - map.put(NULLABLE_TYPE_OF_ANNOTATION_MEMBER, "An annotation parameter cannot be nullable") - map.put(INVALID_TYPE_OF_ANNOTATION_MEMBER, "Invalid type of annotation member") - map.put(VAR_ANNOTATION_PARAMETER, "An annotation parameter cannot be 'var'") - map.put(ANNOTATION_CLASS_CONSTRUCTOR_CALL, "Annotation class cannot be instantiated") - map.put(ENUM_CLASS_CONSTRUCTOR_CALL, "Enum types cannot be instantiated") - map.put(NOT_AN_ANNOTATION_CLASS, "Illegal annotation class: {0}", NULLABLE_STRING) - map.put(SUPERTYPES_FOR_ANNOTATION_CLASS, "Annotation class cannot have supertypes") + map.put(LOCAL_ANNOTATION_CLASS_ERROR, "Annotation class cannot be local.") + map.put(MISSING_VAL_ON_ANNOTATION_PARAMETER, "'val' keyword is missing in annotation parameter.") + map.put(NULLABLE_TYPE_OF_ANNOTATION_MEMBER, "Annotation parameters cannot be nullable.") + map.put(INVALID_TYPE_OF_ANNOTATION_MEMBER, "Invalid type of annotation member.") + map.put(VAR_ANNOTATION_PARAMETER, "An annotation parameter cannot be 'var'.") + map.put(ANNOTATION_CLASS_CONSTRUCTOR_CALL, "Annotation class cannot be instantiated.") + map.put(ENUM_CLASS_CONSTRUCTOR_CALL, "Enum types cannot be instantiated.") + map.put(NOT_AN_ANNOTATION_CLASS, "Illegal annotation class ''{0}''.", NULLABLE_STRING) + map.put(SUPERTYPES_FOR_ANNOTATION_CLASS, "Annotation class cannot have supertypes.") map.put( ILLEGAL_KOTLIN_VERSION_STRING_VALUE, - "Invalid value in version annotation (should be 'major.minor' or 'major.minor.patch')" + "Invalid value in version annotation (should be 'major.minor' or 'major.minor.patch')." ) - map.put(NEWER_VERSION_IN_SINCE_KOTLIN, "The version is greater than the specified API version {0}", NULLABLE_STRING) + map.put(NEWER_VERSION_IN_SINCE_KOTLIN, "The version is greater than the specified API version {0}.", NULLABLE_STRING) map.put( DEPRECATED_SINCE_KOTLIN_WITH_UNORDERED_VERSIONS, - "Values of DeprecatedSinceKotlin annotation should be ordered so 'warningSince' <= 'errorSince' <= 'hiddenSince' if specified" + "Version values in 'DeprecatedSinceKotlin' annotation, if specified, must be such that 'warningSince' <= 'errorSince' <= 'hiddenSince'." ) map.put( DEPRECATED_SINCE_KOTLIN_WITHOUT_ARGUMENTS, - "DeprecatedSinceKotlin annotation should have at least one argument" + "'DeprecatedSinceKotlin' annotation should have at least one argument." ) map.put( DEPRECATED_SINCE_KOTLIN_WITHOUT_DEPRECATED, - "DeprecatedSinceKotlin annotation can only be used together with Deprecated annotation" + "'DeprecatedSinceKotlin' annotation can be used only together with a 'Deprecated' annotation." ) map.put( DEPRECATED_SINCE_KOTLIN_WITH_DEPRECATED_LEVEL, - "DeprecatedSinceKotlin annotation can only be used with an unspecified deprecation level of Deprecated annotation" + "'DeprecatedSinceKotlin' annotation can be used only with an unspecified deprecation level in the 'Deprecated' annotation." ) map.put( DEPRECATED_SINCE_KOTLIN_OUTSIDE_KOTLIN_SUBPACKAGE, - "DeprecatedSinceKotlin annotation cannot be used outside 'kotlin' subpackages" + "'DeprecatedSinceKotlin' annotation cannot be used outside 'kotlin' subpackages." ) map.put( OVERRIDE_DEPRECATION, - "This declaration overrides a deprecated member but is not marked as deprecated itself. Please add the @Deprecated annotation or suppress", + "This declaration overrides a deprecated member but is not marked as deprecated itself. Please add the ''@Deprecated'' annotation or suppress the diagnostic.", EMPTY, EMPTY ) - map.put(ANNOTATION_ON_SUPERCLASS, "Annotations on superclass are meaningless") - map.put(RESTRICTED_RETENTION_FOR_EXPRESSION_ANNOTATION, "Expression annotations with retention other than SOURCE are prohibited") - map.put(WRONG_ANNOTATION_TARGET, "This annotation is not applicable to target ''{0}''", TO_STRING) - map.put(INAPPLICABLE_TARGET_ON_PROPERTY, "''@{0}:'' annotations can only be applied to property declarations", TO_STRING) + map.put(ANNOTATION_ON_SUPERCLASS, "Annotations on superclasses are meaningless.") + map.put(RESTRICTED_RETENTION_FOR_EXPRESSION_ANNOTATION, "Expression annotations with retention other than SOURCE are prohibited.") + map.put(WRONG_ANNOTATION_TARGET, "This annotation is not applicable to target ''{0}''.", TO_STRING) + map.put(INAPPLICABLE_TARGET_ON_PROPERTY, "''@{0}:'' annotations can only be applied to property declarations.", TO_STRING) map.put( INAPPLICABLE_TARGET_ON_PROPERTY_WARNING, - "''@{0}:'' annotations can only be applied to property declarations. It will be an error in a future release. See https://youtrack.jetbrains.com/issue/KT-15470", + "''@{0}:'' annotations can only be applied to property declarations. It will be an error in a future release. See https://youtrack.jetbrains.com/issue/KT-15470.", TO_STRING ) - map.put(INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE, "''@{0}:'' annotations can only be applied to mutable properties", TO_STRING) - map.put(INAPPLICABLE_TARGET_PROPERTY_HAS_NO_DELEGATE, "'@delegate:' annotations can only be applied to delegated properties") + map.put(INAPPLICABLE_TARGET_PROPERTY_IMMUTABLE, "''@{0}:'' annotations can only be applied to mutable properties.", TO_STRING) + map.put(INAPPLICABLE_TARGET_PROPERTY_HAS_NO_DELEGATE, "'@delegate:' annotations can only be applied to delegated properties.") map.put( INAPPLICABLE_TARGET_PROPERTY_HAS_NO_BACKING_FIELD, - "'@field:' annotations can only be applied to properties with backing fields" + "'@field:' annotations can only be applied to properties with backing fields." ) - map.put(INAPPLICABLE_PARAM_TARGET, "'@param:' annotations can only be applied to primary constructor parameters") - map.put(REDUNDANT_ANNOTATION_TARGET, "Redundant annotation target ''{0}''", TO_STRING) - map.put(INAPPLICABLE_FILE_TARGET, "'@file:' annotations can only be applied before package declaration") + map.put(INAPPLICABLE_PARAM_TARGET, "'@param:' annotations can only be applied to primary constructor parameters.") + map.put(REDUNDANT_ANNOTATION_TARGET, "Redundant annotation target ''{0}''.", TO_STRING) + map.put(INAPPLICABLE_FILE_TARGET, "'@file:' annotations can only be applied before package declaration.") map.put( WRONG_ANNOTATION_TARGET_WITH_USE_SITE_TARGET, - "This annotation is not applicable to target ''{0}'' and use site target ''@{1}''", + "This annotation is not applicable to target ''{0}'' and use-site target ''@{1}''.", TO_STRING, TO_STRING ) - map.put(REPEATED_ANNOTATION, "This annotation is not repeatable") - map.put(REPEATED_ANNOTATION_WARNING, "This annotation is not repeatable") - map.put(NON_INTERNAL_PUBLISHED_API, "@PublishedApi annotation is only applicable to internal declaration") - map.put(VOLATILE_ON_VALUE, "'@Volatile' annotation cannot be used on immutable properties") - map.put(VOLATILE_ON_DELEGATE, "'@Volatile' annotation cannot be used on delegated properties") + map.put(REPEATED_ANNOTATION, "This annotation is not repeatable.") + map.put(REPEATED_ANNOTATION_WARNING, "This annotation is not repeatable.") + map.put(NON_INTERNAL_PUBLISHED_API, "'@PublishedApi' annotation is only applicable to internal declaration.") + map.put(VOLATILE_ON_VALUE, "'@Volatile' annotation cannot be used on immutable properties.") + map.put(VOLATILE_ON_DELEGATE, "'@Volatile' annotation cannot be used on delegated properties.") // OptIn map.put(OPT_IN_USAGE, "{1}", TO_STRING, STRING) @@ -988,148 +988,148 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { map.put(OPT_IN_OVERRIDE, "{1}", TO_STRING, STRING) map.put(OPT_IN_OVERRIDE_ERROR, "{1}", TO_STRING, STRING) - map.put(OPT_IN_IS_NOT_ENABLED, "This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn'") - map.put(OPT_IN_CAN_ONLY_BE_USED_AS_ANNOTATION, "This class can only be used as an annotation") + map.put(OPT_IN_IS_NOT_ENABLED, "This annotation should be used with the compiler argument '-opt-in=kotlin.RequiresOptIn'.") + map.put(OPT_IN_CAN_ONLY_BE_USED_AS_ANNOTATION, "This class can only be used as an annotation.") map.put( OPT_IN_MARKER_CAN_ONLY_BE_USED_AS_ANNOTATION_OR_ARGUMENT_IN_OPT_IN, - "This class can only be used as an annotation or as an argument to @OptIn" + "This class can only be used as an annotation or as an argument to @OptIn." ) - map.put(OPT_IN_WITHOUT_ARGUMENTS, "@OptIn without any arguments has no effect") + map.put(OPT_IN_WITHOUT_ARGUMENTS, "@OptIn without any arguments has no effect.") map.put( OPT_IN_ARGUMENT_IS_NOT_MARKER, - "Annotation ''{0}'' is not an opt-in requirement marker, therefore its usage in @OptIn is ignored", + "Annotation ''{0}'' is not an opt-in requirement marker; therefore, its usage in @OptIn is ignored.", TO_STRING ) map.put( OPT_IN_MARKER_WITH_WRONG_TARGET, - "Opt-in requirement marker annotation cannot be used on the following code elements: {0}. Please remove these targets", + "Opt-in requirement marker annotation cannot be used on the following code elements: {0}. Please remove these targets.", STRING ) map.put( OPT_IN_MARKER_WITH_WRONG_RETENTION, - "Opt-in requirement marker annotation cannot be used with SOURCE retention. Please replace retention with BINARY" + "Opt-in requirement marker annotation cannot be used with SOURCE retention. Please replace retention with BINARY." ) - map.put(OPT_IN_MARKER_ON_WRONG_TARGET, "Opt-in requirement marker annotation cannot be used on {0}", STRING) + map.put(OPT_IN_MARKER_ON_WRONG_TARGET, "Opt-in requirement marker annotation cannot be used on {0}.", STRING) map.put( OPT_IN_MARKER_ON_OVERRIDE, - "Opt-in requirement marker annotation on override requires the same marker on base declaration" + "Opt-in requirement marker annotation on override requires the same marker on base declaration." ) map.put( OPT_IN_MARKER_ON_OVERRIDE_WARNING, - "Opt-in requirement marker annotation on override makes no sense without the same marker on base declaration" + "Opt-in requirement marker annotation on override. It's recommended to add the same annotation to the base declaration." ) - map.put(SUBCLASS_OPT_IN_INAPPLICABLE, "@SubclassOptInRequired is inapplicable on {0}", STRING) + map.put(SUBCLASS_OPT_IN_INAPPLICABLE, "@SubclassOptInRequired is not applicable to ''{0}''.", STRING) - map.put(NOT_A_CLASS, "Not a class") + map.put(NOT_A_CLASS, "Not a class.") map.put( WRONG_EXTENSION_FUNCTION_TYPE, - "ExtensionFunctionType is forbidden on a function type without parameters or on a non-function type" + "'@ExtensionFunctionType' is prohibited on a function type without parameters or on a non-function type." ) map.put( WRONG_EXTENSION_FUNCTION_TYPE_WARNING, - "ExtensionFunctionType makes no sense on a non-function type. It will be an error in a future release. See https://youtrack.jetbrains.com/issue/KT-43527" + "'@ExtensionFunctionType' makes no sense on a non-function type. It will be an error in a future release. See https://youtrack.jetbrains.com/issue/KT-43527." ) map.put( ANNOTATION_IN_WHERE_CLAUSE_ERROR, - "Type parameter annotations are not allowed inside where clauses. You should probably move annotations to the type parameter declaration", + "Type parameter annotations are prohibited inside 'where' clauses. You should probably move the annotations to the type parameter declaration.", ) map.put( PLUGIN_ANNOTATION_AMBIGUITY, - "Resolution of the annotation type is ambiguous between ''{1}'' and the plugin annotation ''{0}''. Please specify a fully qualified annotation name", + "Resolution of the annotation type is ambiguous between ''{1}'' and the plugin annotation ''{0}''. Please specify a fully qualified annotation name.", RENDER_TYPE, RENDER_TYPE ) map.put( AMBIGUOUS_ANNOTATION_ARGUMENT, - "Resolution of the annotation argument is ambiguous between {0}. Please use a fully qualified name as argument", + "Resolution of the annotation argument is ambiguous between {0}. Please use a fully qualified name as argument.", SYMBOLS, ) // Exposed visibility group // # map.put( EXPOSED_TYPEALIAS_EXPANDED_TYPE, - "{0} typealias exposes {2} in expanded type ''{1}''", + "Typealias ''{0}'' exposes ''{2}'' in expanded type ''{1}''.", TO_STRING, DECLARATION_NAME, TO_STRING ) map.put( EXPOSED_FUNCTION_RETURN_TYPE, - "{0} function exposes its {2} return type ''{1}''", + "Function ''{0}'' exposes its ''{2}'' return type ''{1}''.", TO_STRING, DECLARATION_NAME, TO_STRING ) - map.put(EXPOSED_RECEIVER_TYPE, "{0} member exposes its {2} receiver type ''{1}''", TO_STRING, DECLARATION_NAME, TO_STRING) - map.put(EXPOSED_PROPERTY_TYPE, "{0} property exposes its {2} type ''{1}''", TO_STRING, DECLARATION_NAME, TO_STRING) - map.put(EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR, "''{0}'' property exposes its ''{2}'' type{1}", TO_STRING, TO_STRING, TO_STRING) - map.put(EXPOSED_PARAMETER_TYPE, "{0} function exposes its {2} parameter type ''{1}''", TO_STRING, DECLARATION_NAME, TO_STRING) - map.put(EXPOSED_SUPER_INTERFACE, "{0} sub-interface exposes its {2} supertype ''{1}''", TO_STRING, DECLARATION_NAME, TO_STRING) - map.put(EXPOSED_SUPER_CLASS, "{0} subclass exposes its {2} supertype ''{1}''", TO_STRING, DECLARATION_NAME, TO_STRING) + map.put(EXPOSED_RECEIVER_TYPE, "Member ''{0}'' exposes its ''{2}'' receiver type ''{1}''.", TO_STRING, DECLARATION_NAME, TO_STRING) + map.put(EXPOSED_PROPERTY_TYPE, "Property ''{0}'' exposes its ''{2}'' type ''{1}''.", TO_STRING, DECLARATION_NAME, TO_STRING) + map.put(EXPOSED_PROPERTY_TYPE_IN_CONSTRUCTOR, "Property ''{0}'' exposes its ''{2}'' type ''{1}''.", TO_STRING, TO_STRING, TO_STRING) + map.put(EXPOSED_PARAMETER_TYPE, "Function ''{0}'' exposes its ''{2}'' parameter type ''{1}''.", TO_STRING, DECLARATION_NAME, TO_STRING) + map.put(EXPOSED_SUPER_INTERFACE, "Sub-interface ''{0}'' exposes its ''{2}'' supertype ''{1}''.", TO_STRING, DECLARATION_NAME, TO_STRING) + map.put(EXPOSED_SUPER_CLASS, "Subclass ''{0}'' exposes its ''{2}'' supertype ''{1}''.", TO_STRING, DECLARATION_NAME, TO_STRING) map.put( EXPOSED_TYPE_PARAMETER_BOUND, - "{0} generic exposes its {2} parameter bound type ''{1}''", + "Generic ''{0}'' exposes its ''{2}'' parameter bound type ''{1}''.", TO_STRING, DECLARATION_NAME, TO_STRING ) // Modifiers - map.put(INAPPLICABLE_INFIX_MODIFIER, "'infix' modifier is inapplicable to this function") - map.put(REPEATED_MODIFIER, "Repeated ''{0}''", TO_STRING) - map.put(REDUNDANT_MODIFIER, "Modifier ''{0}'' is redundant because ''{1}'' is present", TO_STRING, TO_STRING) - map.put(DEPRECATED_MODIFIER, "Modifier ''{0}'' is deprecated, use ''{1}'' instead", TO_STRING, TO_STRING) - map.put(DEPRECATED_MODIFIER_PAIR, "Modifier ''{0}'' is deprecated in presence of ''{1}''", TO_STRING, TO_STRING) - map.put(DEPRECATED_MODIFIER_FOR_TARGET, "Modifier ''{0}'' is deprecated for ''{1}''", TO_STRING, STRING) - map.put(REDUNDANT_MODIFIER_FOR_TARGET, "Modifier ''{0}'' is redundant for ''{1}''", TO_STRING, STRING) - map.put(NO_EXPLICIT_VISIBILITY_IN_API_MODE, "Visibility must be specified in explicit API mode") - map.put(NO_EXPLICIT_RETURN_TYPE_IN_API_MODE, "Return type must be specified in explicit API mode") - map.put(NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING, "Visibility must be specified in explicit API mode") - map.put(NO_EXPLICIT_RETURN_TYPE_IN_API_MODE_WARNING, "Return type must be specified in explicit API mode") + map.put(INAPPLICABLE_INFIX_MODIFIER, "'infix' modifier is inapplicable to this function.") + map.put(REPEATED_MODIFIER, "Repeated ''{0}''.", TO_STRING) + map.put(REDUNDANT_MODIFIER, "Modifier ''{0}'' is redundant because ''{1}'' is present.", TO_STRING, TO_STRING) + map.put(DEPRECATED_MODIFIER, "Modifier ''{0}'' is deprecated; use ''{1}'' instead.", TO_STRING, TO_STRING) + map.put(DEPRECATED_MODIFIER_PAIR, "Modifier ''{0}'' is deprecated in presence of ''{1}''.", TO_STRING, TO_STRING) + map.put(DEPRECATED_MODIFIER_FOR_TARGET, "Modifier ''{0}'' is deprecated for ''{1}''.", TO_STRING, STRING) + map.put(REDUNDANT_MODIFIER_FOR_TARGET, "Modifier ''{0}'' is redundant for ''{1}''.", TO_STRING, STRING) + map.put(NO_EXPLICIT_VISIBILITY_IN_API_MODE, "Visibility must be specified in explicit API mode.") + map.put(NO_EXPLICIT_RETURN_TYPE_IN_API_MODE, "Return type must be specified in explicit API mode.") + map.put(NO_EXPLICIT_VISIBILITY_IN_API_MODE_WARNING, "Visibility must be specified in explicit API mode.") + map.put(NO_EXPLICIT_RETURN_TYPE_IN_API_MODE_WARNING, "Return type must be specified in explicit API mode.") - map.put(INCOMPATIBLE_MODIFIERS, "Modifier ''{0}'' is incompatible with ''{1}''", TO_STRING, TO_STRING) - map.put(REDUNDANT_OPEN_IN_INTERFACE, "Modifier 'open' is redundant for abstract interface members") - map.put(WRONG_MODIFIER_TARGET, "Modifier ''{0}'' is not applicable to ''{1}''", TO_STRING, STRING) - map.put(OPERATOR_MODIFIER_REQUIRED, "''operator'' modifier is required on ''{0}'' in ''{1}''", TO_STRING, STRING) - map.put(INFIX_MODIFIER_REQUIRED, "''infix'' modifier is required on ''{0}''", TO_STRING) - map.put(WRONG_MODIFIER_CONTAINING_DECLARATION, "Modifier ''{0}'' is not applicable inside ''{1}''", TO_STRING, STRING) - map.put(DEPRECATED_MODIFIER_CONTAINING_DECLARATION, "Modifier ''{0}'' is deprecated inside ''{1}''", TO_STRING, STRING) - map.put(INAPPLICABLE_OPERATOR_MODIFIER, "''operator'' modifier is inapplicable on this function: {0}", STRING) + map.put(INCOMPATIBLE_MODIFIERS, "Modifier ''{0}'' is incompatible with ''{1}''.", TO_STRING, TO_STRING) + map.put(REDUNDANT_OPEN_IN_INTERFACE, "Modifier 'open' is redundant for abstract interface members.") + map.put(WRONG_MODIFIER_TARGET, "Modifier ''{0}'' is not applicable to ''{1}''.", TO_STRING, STRING) + map.put(OPERATOR_MODIFIER_REQUIRED, "''operator'' modifier is required on ''{0}'' in ''{1}''.", TO_STRING, STRING) + map.put(INFIX_MODIFIER_REQUIRED, "''infix'' modifier is required on ''{0}''.", TO_STRING) + map.put(WRONG_MODIFIER_CONTAINING_DECLARATION, "Modifier ''{0}'' is not applicable inside ''{1}''.", TO_STRING, STRING) + map.put(DEPRECATED_MODIFIER_CONTAINING_DECLARATION, "Modifier ''{0}'' is deprecated inside ''{1}''.", TO_STRING, STRING) + map.put(INAPPLICABLE_OPERATOR_MODIFIER, "''operator'' modifier is not applicable to function ''{0}''.", STRING) // Classes and interfaces - map.put(SUPERTYPE_NOT_INITIALIZED, "This type has a constructor, and thus must be initialized here") + map.put(SUPERTYPE_NOT_INITIALIZED, "This type has a constructor, so it must be initialized here.") // Applicability - map.put(NONE_APPLICABLE, "None of the following functions are applicable: {0}", SYMBOLS) + map.put(NONE_APPLICABLE, "None of the following functions is applicable: {0}", SYMBOLS) map.put(INAPPLICABLE_CANDIDATE, "Inapplicable candidate(s): {0}", SYMBOL) - map.put(INAPPLICABLE_LATEINIT_MODIFIER, "''lateinit'' modifier {0}", TO_STRING) - map.put(VARARG_OUTSIDE_PARENTHESES, "Passing value as a vararg is only allowed inside a parenthesized argument list") - map.put(NAMED_ARGUMENTS_NOT_ALLOWED, "Named arguments are not allowed for {0}", TO_STRING) - map.put(NON_VARARG_SPREAD, "The spread operator (*foo) may only be applied in a vararg position") - map.put(TOO_MANY_ARGUMENTS, "Too many arguments for {0}", FQ_NAMES_IN_TYPES) - map.put(ARGUMENT_PASSED_TWICE, "An argument is already passed for this parameter") - map.put(NO_VALUE_FOR_PARAMETER, "No value passed for parameter ''{0}''", DECLARATION_NAME) - map.put(NAMED_PARAMETER_NOT_FOUND, "Cannot find a parameter with this name: {0}", TO_STRING) - map.put(NAME_FOR_AMBIGUOUS_PARAMETER, "Named argument is not allowed for a parameter with an ambiguous name") + map.put(INAPPLICABLE_LATEINIT_MODIFIER, "''lateinit'' modifier ''{0}''.", TO_STRING) + map.put(VARARG_OUTSIDE_PARENTHESES, "Passing value as a vararg is allowed only inside a parenthesized argument list.") + map.put(NAMED_ARGUMENTS_NOT_ALLOWED, "Named arguments are prohibited for {0}.", TO_STRING) + map.put(NON_VARARG_SPREAD, "The spread operator (*foo) can only be applied in a vararg position.") + map.put(TOO_MANY_ARGUMENTS, "Too many arguments for ''{0}''.", FQ_NAMES_IN_TYPES) + map.put(ARGUMENT_PASSED_TWICE, "Argument already passed for this parameter.") + map.put(NO_VALUE_FOR_PARAMETER, "No value passed for parameter ''{0}''.", DECLARATION_NAME) + map.put(NAMED_PARAMETER_NOT_FOUND, "No parameter with name ''{0}'' found.", TO_STRING) + map.put(NAME_FOR_AMBIGUOUS_PARAMETER, "Named argument is prohibited for parameter with an ambiguous name.") - map.put(MANY_LAMBDA_EXPRESSION_ARGUMENTS, "Only one lambda expression is allowed outside a parenthesized argument list") - map.put(NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, "Not enough information to infer type variable {0}", STRING) - map.put(SPREAD_OF_NULLABLE, "The spread operator (*foo) may not be applied to an argument of nullable type") + map.put(MANY_LAMBDA_EXPRESSION_ARGUMENTS, "Only one lambda expression is allowed outside a parenthesized argument list.") + map.put(NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, "Not enough information to infer type argument for ''{0}''.", STRING) + map.put(SPREAD_OF_NULLABLE, "The spread operator (*foo) cannot be applied to an argument of nullable type.") map.put( ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_FUNCTION, - "Assigning single elements to varargs in named form is forbidden", + "Assigning single elements to varargs in named form is prohibited.", NOT_RENDERED ) map.put( ASSIGNING_SINGLE_ELEMENT_TO_VARARG_IN_NAMED_FORM_ANNOTATION, - "Assigning single elements to varargs in named form is forbidden" + "Assigning single elements to varargs in named form is prohibited." ) - map.put(REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_ANNOTATION, "Redundant spread (*) operator") - map.put(REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION, "Redundant spread (*) operator") - map.put(INFERENCE_UNSUCCESSFUL_FORK, "Unsuccessful inference fork at position: {0}", TO_STRING) + map.put(REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_ANNOTATION, "Redundant spread (*) operator.") + map.put(REDUNDANT_SPREAD_OPERATOR_IN_NAMED_FORM_IN_FUNCTION, "Redundant spread (*) operator.") + map.put(INFERENCE_UNSUCCESSFUL_FORK, "Unsuccessful inference fork at position ''{0}''.", TO_STRING) map.put( INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION, - "Type argument for a type parameter {0} can''t be inferred because it has incompatible upper bounds: {1} ({2}{3})", + "Type argument for type parameter ''{0}'' cannot be inferred because it has incompatible upper bounds: {1} ({2}{3}).", TO_STRING, RENDER_COLLECTION_OF_TYPES, TO_STRING, @@ -1137,7 +1137,7 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION, - "Type argument for a type parameter {0} has possible incompatible upper bounds: {1} ({2}{3})", + "Type argument for type parameter ''{0}'' has possible incompatible upper bounds: {1} ({2}{3}).", TO_STRING, RENDER_COLLECTION_OF_TYPES, TO_STRING, @@ -1145,76 +1145,76 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( NULLABLE_ON_DEFINITELY_NOT_NULLABLE, - "'!!' type cannot be marked as nullable" + "'!!' type cannot be marked as nullable." ) map.put( INCORRECT_LEFT_COMPONENT_OF_INTERSECTION, - "Intersection types are only supported for definitely non-nullable types: left part should be a type parameter with nullable bounds" + "Intersection types are supported only for definitely non-nullable types: left part should be a type parameter with nullable bounds." ) map.put( INCORRECT_RIGHT_COMPONENT_OF_INTERSECTION, - "Intersection types are only supported for definitely non-nullable types: right part should be non-nullable Any" + "Intersection types are supported only for definitely non-nullable types: right part should be non-nullable 'Any'." ) - map.put(TYPE_MISMATCH, "Type mismatch: inferred type is ''{1}'' but ''{0}'' was expected", RENDER_TYPE, RENDER_TYPE, NOT_RENDERED) + map.put(TYPE_MISMATCH, "Type mismatch: inferred type is ''{1}'', but ''{0}'' was expected.", RENDER_TYPE, RENDER_TYPE, NOT_RENDERED) map.put( TYPE_INFERENCE_ONLY_INPUT_TYPES_ERROR, - "Type inference failed. The value of the type parameter {0} should be mentioned in input types (argument types, receiver type or expected type). Try to specify it explicitly.", + "Type inference failed. The value of the type parameter ''{0}'' should be mentioned in input types (argument types, receiver type, or expected type). Try to specify it explicitly.", SYMBOL ) - map.put(THROWABLE_TYPE_MISMATCH, "Throwable type mismatch: actual type is ''{0}''", RENDER_TYPE, NOT_RENDERED) - map.put(CONDITION_TYPE_MISMATCH, "Condition type mismatch: inferred type is ''{0}'' but Boolean was expected", RENDER_TYPE, NOT_RENDERED) + map.put(THROWABLE_TYPE_MISMATCH, "Throwable type mismatch: actual type is ''{0}''.", RENDER_TYPE, NOT_RENDERED) + map.put(CONDITION_TYPE_MISMATCH, "Condition type mismatch: inferred type is ''{0}'' but ''Boolean'' was expected.", RENDER_TYPE, NOT_RENDERED) map.put( ARGUMENT_TYPE_MISMATCH, - "Argument type mismatch: actual type is ''{1}'' but ''{0}'' was expected", + "Argument type mismatch: actual type is ''{1}'', but ''{0}'' was expected.", RENDER_TYPE, RENDER_TYPE, NOT_RENDERED ) map.put( ASSIGNMENT_TYPE_MISMATCH, - "Assignment type mismatch: actual type is ''{1}'' but ''{0}'' was expected", + "Assignment type mismatch: actual type is ''{1}'', but ''{0}'' was expected.", RENDER_TYPE, RENDER_TYPE, NOT_RENDERED ) map.put( RESULT_TYPE_MISMATCH, - "Function return type mismatch: actual type is ''{1}'' but ''{0}'' was expected", + "Function return type mismatch: actual type is ''{1}'', but ''{0}'' was expected.", RENDER_TYPE, 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, "Non-nullable value required to call an 'iterator()' method in a for-loop.") map.put(ITERATOR_AMBIGUITY, "Method ''iterator()'' is ambiguous for this expression: {0}", SYMBOLS) - map.put(NEXT_MISSING, "Method 'next()' cannot be called on 'iterator()'") + map.put(NEXT_MISSING, "Method 'next()' cannot be called on 'iterator()'.") map.put(NEXT_AMBIGUITY, "Method ''next()'' is ambiguous for this expression: {0}", SYMBOLS) - map.put(AMBIGUOUS_FUNCTION_TYPE_KIND, "Multiple functional type conversions are not allowed for a single type. Detected type conversions: {0}", FUNCTIONAL_TYPE_KINDS) - map.put(NEXT_NONE_APPLICABLE, "None of the ''next()'' functions is applicable for ''iterator()'' of type ''{0}''", SYMBOLS) + map.put(AMBIGUOUS_FUNCTION_TYPE_KIND, "Multiple function type conversions are prohibited for a single type. Detected type conversions: {0}", FUNCTIONAL_TYPE_KINDS) + map.put(NEXT_NONE_APPLICABLE, "None of the ''next()'' functions is applicable for ''iterator()'' of type ''{0}''.", SYMBOLS) - map.put(NO_CONTEXT_RECEIVER, "No required context receiver found: ''{0}''", RENDER_TYPE) + map.put(NO_CONTEXT_RECEIVER, "No context receiver for ''{0}'' found.", RENDER_TYPE) map.put( MULTIPLE_ARGUMENTS_APPLICABLE_FOR_CONTEXT_RECEIVER, - "Multiple arguments applicable for context receiver: ''{0}''", + "Multiple arguments applicable to context receiver ''{0}''.", RENDER_TYPE ) map.put( AMBIGUOUS_CALL_WITH_IMPLICIT_CONTEXT_RECEIVER, - "With implicit context receivers, the call is ambiguous. Please specify the receiver explicitly" + "With implicit context receivers, the call is ambiguous. Please specify the receiver explicitly." ) map.put( UNSUPPORTED_CONTEXTUAL_DECLARATION_CALL, - "To use contextual declarations, specify the `-Xcontext-receivers` compiler option" + "To use contextual declarations, specify the '-Xcontext-receivers' compiler option." ) // Ambiguity map.put(OVERLOAD_RESOLUTION_AMBIGUITY, "Overload resolution ambiguity between candidates: {0}", SYMBOLS) map.put(ASSIGN_OPERATOR_AMBIGUITY, "Ambiguity between assign operator candidates: {0}", SYMBOLS) - map.put(HAS_NEXT_MISSING, "hasNext() cannot be called on iterator()") + map.put(HAS_NEXT_MISSING, "'hasNext()' cannot be called on 'iterator()'.") map.put(HAS_NEXT_FUNCTION_AMBIGUITY, "Method ''hasNext()'' is ambiguous for this expression: {0}", SYMBOLS) - map.put(HAS_NEXT_FUNCTION_NONE_APPLICABLE, "None of the hasNext() functions is applicable for iterator() of type ''{0}''", SYMBOLS) + map.put(HAS_NEXT_FUNCTION_NONE_APPLICABLE, "None of the ''hasNext()'' functions is applicable for ''iterator()'' of type ''{0}''.", SYMBOLS) map.put( UNRESOLVED_REFERENCE_WRONG_RECEIVER, "Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: {0}", @@ -1222,73 +1222,73 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) // Types & type parameters - map.put(RECURSION_IN_IMPLICIT_TYPES, "Recursion in implicit types") - map.put(INFERENCE_ERROR, "Inference error") - map.put(ILLEGAL_PROJECTION_USAGE, "Illegal projection usage") - map.put(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT, "Projections are not allowed on type arguments of functions and properties") - map.put(UPPER_BOUND_VIOLATED, "Type argument is not within its bounds: should be subtype of ''{0}''", RENDER_TYPE, RENDER_TYPE) + map.put(RECURSION_IN_IMPLICIT_TYPES, "Recursion in implicit types.") + map.put(INFERENCE_ERROR, "Inference error.") + map.put(ILLEGAL_PROJECTION_USAGE, "Illegal projection usage.") + map.put(PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT, "Projections on type arguments of functions and properties are prohibited.") + map.put(UPPER_BOUND_VIOLATED, "Type argument is not within its bounds: should be subtype of ''{0}''.", RENDER_TYPE, RENDER_TYPE) map.put( UPPER_BOUND_VIOLATED_IN_TYPEALIAS_EXPANSION, - "Type argument is not within its bounds: should be subtype of ''{0}''", + "Type argument is not within its bounds: should be subtype of ''{0}''.", RENDER_TYPE, RENDER_TYPE ) - map.put(TYPE_ARGUMENTS_NOT_ALLOWED, "Type arguments are not allowed for type parameters") // * + map.put(TYPE_ARGUMENTS_NOT_ALLOWED, "Type parameters cannot be parameterized with type arguments.") // * val wrongNumberOfTypeArguments = "{0,choice,0#No type arguments|1#One type argument|1<{0,number,integer} type arguments} expected" map.put( WRONG_NUMBER_OF_TYPE_ARGUMENTS, - "$wrongNumberOfTypeArguments for {1}", + "$wrongNumberOfTypeArguments for ''{1}''.", null, RENDER_CLASS_OR_OBJECT_NAME ) map.put( NO_TYPE_ARGUMENTS_ON_RHS, - "$wrongNumberOfTypeArguments. Use ''{1}'' if you don''t want to pass type arguments", + "$wrongNumberOfTypeArguments. Use ''{1}'' if you don''t intend to pass type arguments.", null, RENDER_CLASS_OR_OBJECT_NAME ) map.put( OUTER_CLASS_ARGUMENTS_REQUIRED, - "Type arguments should be specified for an outer {0}. Use the full class name to specify them", + "Type arguments should be specified for outer type ''{0}''. Use the full class name to specify them.", RENDER_CLASS_OR_OBJECT_NAME ) - map.put(TYPE_PARAMETERS_IN_OBJECT, "Type parameters are not allowed for objects") - map.put(TYPE_PARAMETERS_IN_ANONYMOUS_OBJECT, "Type parameters for anonymous objects are deprecated") + map.put(TYPE_PARAMETERS_IN_OBJECT, "Type parameters are prohibited for objects.") + map.put(TYPE_PARAMETERS_IN_ANONYMOUS_OBJECT, "Type parameters for anonymous objects are deprecated.") // map.put(ILLEGAL_PROJECTION_USAGE, ...) // & - map.put(TYPE_PARAMETERS_IN_ENUM, "Enum class cannot have type parameters") + map.put(TYPE_PARAMETERS_IN_ENUM, "Enum class cannot have type parameters.") map.put( CONFLICTING_PROJECTION, - "Projection is conflicting with variance of the corresponding type parameter of ''{0}''. Remove the projection or replace it with ''*''", + "Projection is conflicting with variance of the corresponding type parameter of ''{0}''. Remove the projection or replace it with ''*''.", RENDER_TYPE ) map.put( CONFLICTING_PROJECTION_IN_TYPEALIAS_EXPANSION, - "Conflicting projection in type alias expansion in intermediate type ''{0}''", + "Conflicting projection in type alias expansion in intermediate type ''{0}''.", RENDER_TYPE ) map.put( REDUNDANT_PROJECTION, - "Projection is redundant: the corresponding type parameter of ''{0}'' has the same variance", + "Projection is redundant: the corresponding type parameter of ''{0}'' has the same variance.", RENDER_TYPE ) map.put( VARIANCE_ON_TYPE_PARAMETER_NOT_ALLOWED, - "Variance annotations are only allowed for type parameters of classes and interfaces" + "Variance annotations are only allowed for type parameters of classes and interfaces." ) - map.put(CATCH_PARAMETER_WITH_DEFAULT_VALUE, "Catch clause parameter may not have a default value") - map.put(REIFIED_TYPE_IN_CATCH_CLAUSE, "Reified type is forbidden for catch parameter") - map.put(TYPE_PARAMETER_IN_CATCH_CLAUSE, "Type parameter is forbidden for catch parameter") + map.put(CATCH_PARAMETER_WITH_DEFAULT_VALUE, "Catch clause parameter cannot have a default value.") + map.put(REIFIED_TYPE_IN_CATCH_CLAUSE, "Reified type is prohibited for catch parameter.") + map.put(TYPE_PARAMETER_IN_CATCH_CLAUSE, "Type parameter is prohibited for catch parameter.") map.put( KCLASS_WITH_NULLABLE_TYPE_PARAMETER_IN_SIGNATURE, "Declaration has an inconsistent return type. " + - "Please add upper bound Any for type parameter ''{0}'' or specify return type explicitly", + "Please add upper bound ''Any'' for type parameter ''{0}'' or specify return type explicitly.", SYMBOL ) - map.put(TYPE_PARAMETER_AS_REIFIED, "Cannot use ''{0}'' as reified type parameter. Use a class instead", SYMBOL) + map.put(TYPE_PARAMETER_AS_REIFIED, "Cannot use ''{0}'' as reified type parameter. Use a class instead.", SYMBOL) map.put( TYPE_PARAMETER_AS_REIFIED_ARRAY, "Cannot use ''{0}'' as reified type parameter, since the array type parameter is not reified.", @@ -1296,24 +1296,24 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( REIFIED_TYPE_FORBIDDEN_SUBSTITUTION, - "Cannot use ''{0}'' as reified type parameter", + "Cannot use ''{0}'' as reified type parameter.", RENDER_TYPE ) map.put( DEFINITELY_NON_NULLABLE_AS_REIFIED, - "Cannot use definitely-non-nullable type as reified type argument", + "Cannot use definitely-non-nullable type as a reified type argument.", ) map.put( FINAL_UPPER_BOUND, - "''{0}'' is a final type, and thus a value of the type parameter is predetermined", + "Type ''{0}'' is final, so the value of the type parameter is predetermined.", RENDER_TYPE ) - map.put(UPPER_BOUND_IS_EXTENSION_FUNCTION_TYPE, "Extension function type can not be used as an upper bound") - map.put(INCOMPATIBLE_TYPES, "Incompatible types: ''{0}'' and ''{1}''", RENDER_TYPE, RENDER_TYPE) - map.put(INCOMPATIBLE_TYPES_WARNING, "Potentially incompatible types: ''{0}'' and ''{1}''", RENDER_TYPE, RENDER_TYPE) + map.put(UPPER_BOUND_IS_EXTENSION_FUNCTION_TYPE, "Extension function type cannot be used as an upper bound.") + map.put(INCOMPATIBLE_TYPES, "Incompatible types ''{0}'' and ''{1}''.", RENDER_TYPE, RENDER_TYPE) + map.put(INCOMPATIBLE_TYPES_WARNING, "Potentially incompatible types ''{0}'' and ''{1}''.", RENDER_TYPE, RENDER_TYPE) map.put( SMARTCAST_IMPOSSIBLE, - "Smart cast to ''{0}'' is impossible, because ''{1}'' is a {2}", + "Smart cast to ''{0}'' is impossible, because ''{1}'' is a {2}.", RENDER_TYPE, CALLEE_NAME, TO_STRING, @@ -1322,117 +1322,117 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { map.put( TYPE_VARIANCE_CONFLICT_ERROR, - "Type parameter {0} is declared as ''{1}'' but occurs in ''{2}'' position in type ''{3}''", + "Type parameter ''{0}'' is declared as ''{1}'' but occurs in ''{2}'' position in type ''{3}''.", SYMBOL, RENDER_POSITION_VARIANCE, RENDER_POSITION_VARIANCE, RENDER_TYPE ) map.put( TYPE_VARIANCE_CONFLICT_IN_EXPANDED_TYPE, - "Type parameter {0} is declared as ''{1}'' but occurs in ''{2}'' position in abbreviated type ''{3}''", + "Type parameter ''{0}'' is declared as ''{1}'' but occurs in ''{2}'' position in abbreviated type ''{3}''.", SYMBOL, RENDER_POSITION_VARIANCE, RENDER_POSITION_VARIANCE, RENDER_TYPE ) map.put( BOUNDS_NOT_ALLOWED_IF_BOUNDED_BY_TYPE_PARAMETER, - "Type parameter cannot have any other bounds if it's bounded by another type parameter" + "Type parameter cannot have any other bounds if it's bounded by another type parameter." ) - map.put(ONLY_ONE_CLASS_BOUND_ALLOWED, "Only one of the upper bounds can be a class") - map.put(REPEATED_BOUND, "Type parameter already has this bound") + map.put(ONLY_ONE_CLASS_BOUND_ALLOWED, "Only one of the upper bounds can be a class.") + map.put(REPEATED_BOUND, "Type parameter already has this bound.") map.put( CONFLICTING_UPPER_BOUNDS, - "Upper bounds of {0} have empty intersection", + "Upper bounds of ''{0}'' have an empty intersection.", SYMBOL ) map.put( NAME_IN_CONSTRAINT_IS_NOT_A_TYPE_PARAMETER, - "{0} does not refer to a type parameter of {1}", + "''{0}'' does not refer to a type parameter of ''{1}''.", TO_STRING, DECLARATION_NAME ) - map.put(BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED, "Bounds are not allowed on type alias parameters") + map.put(BOUND_ON_TYPE_ALIAS_PARAMETER_NOT_ALLOWED, "Bounds on type alias parameters are prohibited.") - map.put(REIFIED_TYPE_PARAMETER_NO_INLINE, "Only type parameters of inline functions can be reified") + map.put(REIFIED_TYPE_PARAMETER_NO_INLINE, "Only type parameters of inline functions can be reified.") - map.put(TYPE_PARAMETERS_NOT_ALLOWED, "Type parameters are not allowed here") + map.put(TYPE_PARAMETERS_NOT_ALLOWED, "Type parameters are prohibited here.") - map.put(TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER, "Type parameter of a property must be used in its receiver type") + map.put(TYPE_PARAMETER_OF_PROPERTY_NOT_USED_IN_RECEIVER, "Type parameter of a property must be used in its receiver type.") - map.put(NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY, "A 'return' expression is required in a function with a block body ('{...}')") + map.put(NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY, "A 'return' expression is required in a function with a block body ('{...}').") map.put( RETURN_TYPE_MISMATCH, - "Return type mismatch: expected ''{0}'', actual ''{1}''", + "Return type mismatch: expected ''{0}'', actual ''{1}''.", RENDER_TYPE, RENDER_TYPE, NOT_RENDERED, NOT_RENDERED ) - 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, "Return type 'Nothing' needs to be specified explicitly.") + map.put(IMPLICIT_NOTHING_PROPERTY_TYPE, "Property type 'Nothing' needs to be specified explicitly.") - map.put(CYCLIC_GENERIC_UPPER_BOUND, "Type parameter has cyclic upper bounds") + map.put(CYCLIC_GENERIC_UPPER_BOUND, "Type parameter has cyclic upper bounds.") - map.put(FINITE_BOUNDS_VIOLATION, "This type parameter violates the Finite Bound Restriction") + map.put(FINITE_BOUNDS_VIOLATION, "This type parameter violates the Finite Bound Restriction.") map.put(FINITE_BOUNDS_VIOLATION_IN_JAVA, "Violation of Finite Bound Restriction for {0}", commaSeparated(DECLARATION_NAME)) - map.put(DEPRECATED_TYPE_PARAMETER_SYNTAX, "Type parameters must be placed before the name of the function") + map.put(DEPRECATED_TYPE_PARAMETER_SYNTAX, "Type parameters must be placed before function name.") map.put( MISPLACED_TYPE_PARAMETER_CONSTRAINTS, - "If a type parameter has multiple constraints, they all need to be placed in the 'where' clause" + "If a type parameter has multiple constraints, they all need to be placed in the 'where' clause." ) - map.put(DYNAMIC_SUPERTYPE, "A supertype cannot be dynamic") + map.put(DYNAMIC_SUPERTYPE, "Supertypes cannot be dynamic.") - map.put(DYNAMIC_UPPER_BOUND, "Dynamic type can not be used as an upper bound") + map.put(DYNAMIC_UPPER_BOUND, "Dynamic type cannot be used as an upper bound.") - map.put(DYNAMIC_RECEIVER_NOT_ALLOWED, "Dynamic receiver is prohibited") + map.put(DYNAMIC_RECEIVER_NOT_ALLOWED, "Dynamic receivers are prohibited.") // Reflection map.put( EXTENSION_IN_CLASS_REFERENCE_NOT_ALLOWED, - "''{0}'' is a member and an extension at the same time. References to such elements are not allowed", + "''{0}'' is a member and an extension at the same time. References to such elements are prohibited.", DECLARATION_NAME ) - map.put(CALLABLE_REFERENCE_LHS_NOT_A_CLASS, "Left-hand side of a callable reference cannot be a type parameter") - map.put(CALLABLE_REFERENCE_TO_ANNOTATION_CONSTRUCTOR, "Annotation class cannot be instantiated") + map.put(CALLABLE_REFERENCE_LHS_NOT_A_CLASS, "Left-hand side of callable reference cannot be a type parameter.") + map.put(CALLABLE_REFERENCE_TO_ANNOTATION_CONSTRUCTOR, "Annotation class cannot be instantiated.") - map.put(CLASS_LITERAL_LHS_NOT_A_CLASS, "Only classes are allowed on the left-hand side of a class literal") - map.put(NULLABLE_TYPE_IN_CLASS_LITERAL_LHS, "Type in a class literal must not be nullable") + map.put(CLASS_LITERAL_LHS_NOT_A_CLASS, "Only classes are allowed on the left-hand side of a class literal.") + map.put(NULLABLE_TYPE_IN_CLASS_LITERAL_LHS, "Type in a class literal must not be nullable.") map.put( EXPRESSION_OF_NULLABLE_TYPE_IN_CLASS_LITERAL_LHS, - "Expression in a class literal has a nullable type ''{0}'', use !! to make the type non-nullable", + "Expression in class literal has nullable type ''{0}''. Use ''!!'' to make the type non-nullable.", RENDER_TYPE ) - map.put(UNSUPPORTED_CLASS_LITERALS_WITH_EMPTY_LHS, "Class literals with empty left hand side are unsupported") + map.put(UNSUPPORTED_CLASS_LITERALS_WITH_EMPTY_LHS, "Class literals with empty left hand side are unsupported.") // Value classes - map.put(VALUE_CLASS_NOT_TOP_LEVEL, "Value class cannot be local or inner") - map.put(VALUE_CLASS_NOT_FINAL, "Value class can only be final") - map.put(ABSENCE_OF_PRIMARY_CONSTRUCTOR_FOR_VALUE_CLASS, "Primary constructor is required for value class") - map.put(INLINE_CLASS_CONSTRUCTOR_WRONG_PARAMETERS_SIZE, "Inline class must have exactly one primary constructor parameter") - map.put(VALUE_CLASS_EMPTY_CONSTRUCTOR, "Value class must have at least one primary constructor parameter") + map.put(VALUE_CLASS_NOT_TOP_LEVEL, "Value class cannot be local or inner.") + map.put(VALUE_CLASS_NOT_FINAL, "Value class can be only final.") + map.put(ABSENCE_OF_PRIMARY_CONSTRUCTOR_FOR_VALUE_CLASS, "Primary constructor is required for value classes.") + map.put(INLINE_CLASS_CONSTRUCTOR_WRONG_PARAMETERS_SIZE, "Inline class must have exactly one primary constructor parameter.") + map.put(VALUE_CLASS_EMPTY_CONSTRUCTOR, "Value class must have at least one primary constructor parameter.") map.put( VALUE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER, - "Value class primary constructor must only have final read-only (val) property parameters" + "Value class primary constructor must only have final read-only ('val') property parameters." ) - map.put(PROPERTY_WITH_BACKING_FIELD_INSIDE_VALUE_CLASS, "Value class cannot have properties with backing fields") - map.put(DELEGATED_PROPERTY_INSIDE_VALUE_CLASS, "Value class cannot have delegated properties") - map.put(VALUE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE, "Value class cannot have value parameter of type ''{0}''", TO_STRING) - map.put(VALUE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION, "Value class cannot implement an interface by delegation") - map.put(VALUE_CLASS_CANNOT_EXTEND_CLASSES, "Value class cannot extend classes") - map.put(VALUE_CLASS_CANNOT_BE_RECURSIVE, "Value class cannot be recursive") + map.put(PROPERTY_WITH_BACKING_FIELD_INSIDE_VALUE_CLASS, "Value class cannot have properties with backing fields.") + map.put(DELEGATED_PROPERTY_INSIDE_VALUE_CLASS, "Value class cannot have delegated properties.") + map.put(VALUE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE, "Value class cannot have value parameter of type ''{0}''.", TO_STRING) + map.put(VALUE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION, "Value class cannot implement an interface by delegation.") + map.put(VALUE_CLASS_CANNOT_EXTEND_CLASSES, "Value class cannot extend classes.") + map.put(VALUE_CLASS_CANNOT_BE_RECURSIVE, "Value class cannot be recursive.") map.put( MULTI_FIELD_VALUE_CLASS_PRIMARY_CONSTRUCTOR_DEFAULT_PARAMETER, - "Default parameters are not supported in the primary constructor of a multi-field value class" + "Default parameters are not supported in the primary constructor of a multi-field value class." ) map.put( INVALID_DEFAULT_FUNCTIONAL_PARAMETER_FOR_INLINE, - "Invalid default value for inline function parameter. Only lambdas, anonymous functions, and callable references are supported", + "Invalid default value for inline function parameter. Only lambdas, anonymous functions, and callable references are supported.", DECLARATION_NAME ) map.put( @@ -1442,16 +1442,16 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_VALUE_CLASS, - "Secondary constructors with bodies are reserved for future releases" + "Secondary constructors with bodies are reserved for future releases." ) - map.put(RESERVED_MEMBER_INSIDE_VALUE_CLASS, "Member with the name ''{0}'' is reserved for future releases", TO_STRING) - map.put(TYPE_ARGUMENT_ON_TYPED_VALUE_CLASS_EQUALS, "Type arguments for typed value class equals must all be star projections") - map.put(INNER_CLASS_INSIDE_VALUE_CLASS, "Value class cannot have inner classes") - map.put(VALUE_CLASS_CANNOT_BE_CLONEABLE, "Value class cannot be Cloneable") - map.put(VALUE_CLASS_CANNOT_HAVE_CONTEXT_RECEIVERS, "Value classes cannot have context receivers") + map.put(RESERVED_MEMBER_INSIDE_VALUE_CLASS, "Member name ''{0}'' is reserved for future releases.", TO_STRING) + map.put(TYPE_ARGUMENT_ON_TYPED_VALUE_CLASS_EQUALS, "Type arguments for typed value class equals must all be star projections.") + map.put(INNER_CLASS_INSIDE_VALUE_CLASS, "Value class cannot have inner classes.") + map.put(VALUE_CLASS_CANNOT_BE_CLONEABLE, "Value class cannot be 'Cloneable'.") + map.put(VALUE_CLASS_CANNOT_HAVE_CONTEXT_RECEIVERS, "Value classes cannot have context receivers.") map.put( ANNOTATION_ON_ILLEGAL_MULTI_FIELD_VALUE_CLASS_TYPED_TARGET, - "Annotations on ''{0}'' of multi-field value class type are not supported", + "Annotations on ''{0}'' of multi-field value class type are not supported.", STRING ) @@ -1459,36 +1459,36 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { // Inline map.put( DECLARATION_CANT_BE_INLINED, - "'inline' modifier is not allowed on virtual members. Only private or final members can be inlined" + "'inline' modifier on virtual members is prohibited. Only private or final members can be inlined." ) - map.put(OVERRIDE_BY_INLINE, "Override by an inline function") - map.put(REIFIED_TYPE_PARAMETER_IN_OVERRIDE, "Override by a function with reified type parameter") - map.put(INLINE_PROPERTY_WITH_BACKING_FIELD, "Inline property cannot have backing field") + map.put(OVERRIDE_BY_INLINE, "Override by an inline function.") + map.put(REIFIED_TYPE_PARAMETER_IN_OVERRIDE, "Override by a function with reified type parameter.") + map.put(INLINE_PROPERTY_WITH_BACKING_FIELD, "Inline property cannot have a backing field.") // Overrides - map.put(NOTHING_TO_OVERRIDE, "''{0}'' overrides nothing", DECLARATION_NAME) + map.put(NOTHING_TO_OVERRIDE, "''{0}'' overrides nothing.", DECLARATION_NAME) map.put( CANNOT_OVERRIDE_INVISIBLE_MEMBER, - "''{0}'' has no access to ''{1}'', so it cannot override it", + "''{0}'' has no access to ''{1}'', so it cannot override it.", FQ_NAMES_IN_TYPES, FQ_NAMES_IN_TYPES ) map.put(TYPEALIAS_EXPANDS_TO_ARRAY_OF_NOTHINGS, "Type alias expanded to malformed type ''{0}''", RENDER_TYPE) - map.put(OVERRIDING_FINAL_MEMBER, "''{0}'' in ''{1}'' is final and cannot be overridden", DECLARATION_NAME, TO_STRING) + map.put(OVERRIDING_FINAL_MEMBER, "''{0}'' in ''{1}'' is final and cannot be overridden.", DECLARATION_NAME, TO_STRING) map.put( CANNOT_WEAKEN_ACCESS_PRIVILEGE, - "Cannot weaken access privilege ''{0}'' for ''{1}'' in ''{2}''", + "Cannot weaken access privilege {0} for ''{1}'' in ''{2}''.", VISIBILITY, DECLARATION_NAME, TO_STRING ) map.put( CANNOT_CHANGE_ACCESS_PRIVILEGE, - "Cannot change access privilege ''{0}'' for ''{1}'' in ''{2}''", + "Cannot change access privilege {0} for ''{1}'' in ''{2}''.", VISIBILITY, DECLARATION_NAME, TO_STRING @@ -1496,7 +1496,7 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { map.put( ABSTRACT_MEMBER_NOT_IMPLEMENTED, - "{0} is not abstract and does not implement abstract member {1}", + "''{0}'' is not abstract and does not implement abstract member ''{1}''.", RENDER_CLASS_OR_OBJECT, DECLARATION_NAME ) @@ -1508,71 +1508,71 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED, - "{0} is not abstract and does not implement abstract base class member {1}", + "''{0}'' is not abstract and does not implement abstract base class member ''{1}''.", RENDER_CLASS_OR_OBJECT, DECLARATION_NAME ) map.put( INVISIBLE_ABSTRACT_MEMBER_FROM_SUPER, - "{0} inherits invisible abstract members: {1}", + "''{0}'' inherits invisible abstract members: ''{1}''.", DECLARATION_NAME, FQ_NAMES_IN_TYPES ) - map.put(AMBIGUOUS_ANONYMOUS_TYPE_INFERRED, "Right-hand side has anonymous type. Please specify type explicitly", NOT_RENDERED) + map.put(AMBIGUOUS_ANONYMOUS_TYPE_INFERRED, "Right-hand side has an anonymous type. Please specify the type explicitly.", NOT_RENDERED) map.put( MANY_IMPL_MEMBER_NOT_IMPLEMENTED, - "{0} must override {1} because it inherits multiple implementations of it", + "''{0}'' must override ''{1}'' because it inherits multiple implementations for it.", RENDER_CLASS_OR_OBJECT, DECLARATION_NAME ) map.put( MANY_INTERFACES_MEMBER_NOT_IMPLEMENTED, - "{0} must override {1} because it inherits multiple interface methods of it", + "''{0}'' must override ''{1}'' because it inherits multiple interface methods for it.", RENDER_CLASS_OR_OBJECT, DECLARATION_NAME ) map.put( RETURN_TYPE_MISMATCH_ON_OVERRIDE, - "Return type of ''{0}'' is not a subtype of the return type of the overridden member ''{1}''", + "Return type of ''{0}'' is not a subtype of the return type of the overridden member ''{1}''.", DECLARATION_NAME, SYMBOL ) map.put( PROPERTY_TYPE_MISMATCH_ON_OVERRIDE, - "Type of ''{0}'' is not a subtype of the overridden property ''{1}''", + "Type of ''{0}'' is not a subtype of overridden property ''{1}''.", DECLARATION_NAME, SYMBOL ) map.put( VAR_TYPE_MISMATCH_ON_OVERRIDE, - "Type of ''{0}'' doesn''t match the type of the overridden var-property ''{1}''", + "Type of ''{0}'' doesn''t match the type of the overridden ''var'' property ''{1}''.", DECLARATION_NAME, SYMBOL ) map.put( VAR_OVERRIDDEN_BY_VAL, - "Var-property {0} cannot be overridden by val-property {1}", + "''var'' property ''{0}'' cannot be overridden by ''val'' property ''{1}''.", FQ_NAMES_IN_TYPES, FQ_NAMES_IN_TYPES ) map.put( VAR_IMPLEMENTED_BY_INHERITED_VAL, - "{0} implements var-property {1} by inherited val-property {2}", + "''{0}'' overrides ''var'' property ''{1}'' with inherited ''val'' property ''{2}''.", RENDER_CLASS_OR_OBJECT, DECLARATION_NAME, FQ_NAMES_IN_TYPES ) - 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 on a final class.") + map.put(NON_FINAL_MEMBER_IN_OBJECT, "'open' has no effect on object.") map.put( - VIRTUAL_MEMBER_HIDDEN, "''{0}'' hides member of supertype ''{1}'' and needs ''override'' modifier", DECLARATION_NAME, + VIRTUAL_MEMBER_HIDDEN, "''{0}'' hides member of supertype ''{1}'' and needs an ''override'' modifier.", DECLARATION_NAME, DECLARATION_NAME ) map.put( DATA_CLASS_OVERRIDE_CONFLICT, - "Function ''{0}'' generated for the data class conflicts with member of supertype ''{1}''", + "Function ''{0}'' generated for the data class conflicts with a member of supertype ''{1}''.", FQ_NAMES_IN_TYPES, FQ_NAMES_IN_TYPES ) @@ -1585,297 +1585,297 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { map.put( GENERIC_THROWABLE_SUBCLASS, - "Subclass of 'Throwable' may not have type parameters" + "Subclass of 'Throwable' cannot have type parameters." ) map.put( INNER_CLASS_OF_GENERIC_THROWABLE_SUBCLASS, - "Inner class of generic class extending 'Throwable' is prohibited" + "Inner class of generic class extending 'Throwable' is prohibited." ) map.put( RETURN_TYPE_MISMATCH_ON_INHERITANCE, - "''{0}'' clashes with ''{1}'': return types are incompatible", + "''{0}'' clashes with ''{1}'': return types are incompatible.", DECLARATION_NAME, DECLARATION_NAME ) map.put( PROPERTY_TYPE_MISMATCH_ON_INHERITANCE, - "''{0}'' clashes with ''{1}'': property types are incompatible", + "''{0}'' clashes with ''{1}'': property types are incompatible.", DECLARATION_NAME, DECLARATION_NAME ) map.put( VAR_TYPE_MISMATCH_ON_INHERITANCE, - "''{0}'' clashes with ''{1}'': property types do not match", + "''{0}'' clashes with ''{1}'': property types do not match.", DECLARATION_NAME, DECLARATION_NAME ) map.put( RETURN_TYPE_MISMATCH_BY_DELEGATION, - "Type of ''{0}'' is not a subtype of overridden by delegation ''{1}''", + "''{0}'' clashes with ''{1}'' from delegation: return types are incompatible.", DECLARATION_NAME, DECLARATION_NAME ) map.put( PROPERTY_TYPE_MISMATCH_BY_DELEGATION, - "Type of property ''{0}'' is not a subtype of overridden by delegation ''{1}''", + "''{0}'' clashes with ''{1}'' from delegation: property types are incompatible.", DECLARATION_NAME, DECLARATION_NAME ) map.put( OVERRIDING_FINAL_MEMBER_BY_DELEGATION, - "''{0}'' implicitly overrides a final member ''{1}'' by delegation", + "''{0}'' implicitly overrides a final member ''{1}'' by delegation.", DECLARATION_NAME, DECLARATION_NAME ) map.put( VAR_OVERRIDDEN_BY_VAL_BY_DELEGATION, - "Val-property ''{0}'' implicitly overrides a var-property ''{1}'' by delegation", + "''val'' property ''{0}'' implicitly overrides a ''var'' property ''{1}'' by delegation.", DECLARATION_NAME, DECLARATION_NAME ) map.put( CONFLICTING_INHERITED_MEMBERS, - "{0} inherits conflicting members: {1}", + "''{0}'' inherits conflicting members: {1}.", DECLARATION_NAME, commaSeparated(DECLARATION_NAME) ) // Redeclarations - map.put(MANY_COMPANION_OBJECTS, "Only one companion object is allowed per class") + map.put(MANY_COMPANION_OBJECTS, "Only one companion object is allowed per class.") map.put(CONFLICTING_OVERLOADS, "Conflicting overloads: {0}", SYMBOLS) map.put(REDECLARATION, "Conflicting declarations: {0}", SYMBOLS) map.put(PACKAGE_OR_CLASSIFIER_REDECLARATION, "Redeclaration: {0}", SYMBOLS) - map.put(METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE, "An interface may not implement a method of 'Any'") + map.put(METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE, "Interfaces cannot implement a method of 'Any'.") // Invalid local declarations map.put( LOCAL_OBJECT_NOT_ALLOWED, - "Named object ''{0}'' is a singleton and cannot be local. Try to use an anonymous object instead", + "Named object ''{0}'' cannot be local. Try to use an anonymous object instead.", TO_STRING ) // + map.put( LOCAL_INTERFACE_NOT_ALLOWED, - "''{0}'' is an interface, so it cannot be local. Try to use an anonymous object or abstract class instead", + "''{0}'' is an interface, so it cannot be local. Try to use an anonymous object or abstract class instead.", TO_STRING ) // Functions map.put( ABSTRACT_FUNCTION_IN_NON_ABSTRACT_CLASS, - "Abstract function ''{0}'' in non-abstract class ''{1}''", + "Abstract function ''{0}'' in non-abstract class ''{1}''.", DECLARATION_NAME, DECLARATION_NAME ) - map.put(ABSTRACT_FUNCTION_WITH_BODY, "A function ''{0}'' with body cannot be abstract", DECLARATION_NAME) - map.put(NON_ABSTRACT_FUNCTION_WITH_NO_BODY, "Function ''{0}'' without a body must be abstract", DECLARATION_NAME) - map.put(PRIVATE_FUNCTION_WITH_NO_BODY, "Function ''{0}'' without body cannot be private", DECLARATION_NAME) - map.put(NON_MEMBER_FUNCTION_NO_BODY, "Function ''{0}'' must have a body", DECLARATION_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(ABSTRACT_FUNCTION_WITH_BODY, "Function ''{0}'' with a body cannot be abstract.", DECLARATION_NAME) + map.put(NON_ABSTRACT_FUNCTION_WITH_NO_BODY, "Function ''{0}'' without a body must be abstract.", DECLARATION_NAME) + map.put(PRIVATE_FUNCTION_WITH_NO_BODY, "Function ''{0}'' without a body cannot be private.", DECLARATION_NAME) + map.put(NON_MEMBER_FUNCTION_NO_BODY, "Function ''{0}'' must have a body.", DECLARATION_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( ANONYMOUS_FUNCTION_PARAMETER_WITH_DEFAULT_VALUE, - "An anonymous function is not allowed to specify default values for its parameters" + "Anonymous functions cannot specify default values for their parameters." ) - map.put(USELESS_VARARG_ON_PARAMETER, "Vararg on this parameter is useless") + map.put(USELESS_VARARG_ON_PARAMETER, "Vararg on this parameter is useless.") map.put( FUN_INTERFACE_WRONG_COUNT_OF_ABSTRACT_MEMBERS, - "Fun interface must have exactly one abstract function" + "Functional interface must have exactly one abstract function." ) - map.put(FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES, "Fun interface can not have abstract properties") - map.put(FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS, "Fun interface can not have abstract method with type parameters") - map.put(FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE, "Fun interface abstract method can not have a default value") - map.put(FUN_INTERFACE_WITH_SUSPEND_FUNCTION, "Fun interface abstract method can not be suspend") + map.put(FUN_INTERFACE_CANNOT_HAVE_ABSTRACT_PROPERTIES, "Functional interface cannot have abstract properties.") + map.put(FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS, "Functional interface cannot have an abstract method with type parameters.") + map.put(FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE, "Functional interface abstract method cannot have a default value.") + map.put(FUN_INTERFACE_WITH_SUSPEND_FUNCTION, "Functional interface abstract method cannot have a suspend modifier.") - map.put(MULTIPLE_VARARG_PARAMETERS, "Multiple vararg-parameters are prohibited") - map.put(FORBIDDEN_VARARG_PARAMETER_TYPE, "Forbidden vararg parameter type: ''{0}''", RENDER_TYPE) - map.put(VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION, "A type annotation is required on a value parameter") - map.put(CANNOT_INFER_PARAMETER_TYPE, "cannot infer a type for this parameter. Please specify it explicitly.") + map.put(MULTIPLE_VARARG_PARAMETERS, "Multiple vararg parameters are prohibited.") + map.put(FORBIDDEN_VARARG_PARAMETER_TYPE, "Prohibited vararg parameter type ''{0}''.", RENDER_TYPE) + map.put(VALUE_PARAMETER_WITH_NO_TYPE_ANNOTATION, "A type annotation is required on a value parameter.") + map.put(CANNOT_INFER_PARAMETER_TYPE, "Cannot infer type for this parameter. Please specify it explicitly.") map.put(NO_TAIL_CALLS_FOUND, "A function is marked as tail-recursive but no tail calls are found.") - map.put(TAILREC_ON_VIRTUAL_MEMBER_ERROR, "Tailrec is not allowed on open members") - map.put(NON_TAIL_RECURSIVE_CALL, "Recursive call is not a tail call") - map.put(TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED, "Tail recursion optimization inside try/catch/finally is not supported") - map.put(DATA_OBJECT_CUSTOM_EQUALS_OR_HASH_CODE, "Data object cannot have a custom implementation of 'equals' or 'hashCode'") + map.put(TAILREC_ON_VIRTUAL_MEMBER_ERROR, "Tailrec is prohibited on open members.") + map.put(NON_TAIL_RECURSIVE_CALL, "Recursive call is not a tail call.") + map.put(TAIL_RECURSION_IN_TRY_IS_NOT_SUPPORTED, "Tail recursion optimization inside try/catch/finally is not supported.") + map.put(DATA_OBJECT_CUSTOM_EQUALS_OR_HASH_CODE, "Data object cannot have a custom implementation of 'equals' or 'hashCode'.") // Parameter default values map.put(DEFAULT_VALUE_NOT_ALLOWED_IN_OVERRIDE, "An overriding function is not allowed to specify default values for its parameters.") // Fun interfaces - map.put(FUN_INTERFACE_CONSTRUCTOR_REFERENCE, "Functional/SAM interface constructor references are prohibited") + map.put(FUN_INTERFACE_CONSTRUCTOR_REFERENCE, "Functional interface constructor references are prohibited.") // Properties & accessors map.put( ABSTRACT_PROPERTY_IN_NON_ABSTRACT_CLASS, - "Abstract property ''{0}'' in non-abstract class ''{1}''", + "Abstract property ''{0}'' in non-abstract class ''{1}''.", DECLARATION_NAME, DECLARATION_NAME ) - map.put(PRIVATE_PROPERTY_IN_INTERFACE, "Abstract property in an interface cannot be private") + map.put(PRIVATE_PROPERTY_IN_INTERFACE, "Abstract property in interface cannot be private.") - map.put(ABSTRACT_PROPERTY_WITH_INITIALIZER, "Property with initializer cannot be abstract") - map.put(PROPERTY_INITIALIZER_IN_INTERFACE, "Property initializers are not allowed in interfaces") + map.put(ABSTRACT_PROPERTY_WITH_INITIALIZER, "Property with initializer cannot be abstract.") + map.put(PROPERTY_INITIALIZER_IN_INTERFACE, "Property initializers in interfaces are prohibited.") map.put( PROPERTY_WITH_NO_TYPE_NO_INITIALIZER, - "This property must either have a type annotation, be initialized or be delegated" + "This property must have a type annotation, be initialized, or be delegated." ) - map.put(VARIABLE_WITH_NO_TYPE_NO_INITIALIZER, "This variable must either have a type annotation or be initialized") + map.put(VARIABLE_WITH_NO_TYPE_NO_INITIALIZER, "This variable must either have a type annotation or be initialized.") - map.put(INITIALIZATION_BEFORE_DECLARATION, "Variable cannot be initialized before declaration", SYMBOL) - map.put(TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, "Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly") + map.put(INITIALIZATION_BEFORE_DECLARATION, "Variable cannot be initialized before declaration.", SYMBOL) + map.put(TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM, "Type checking has run into a recursive problem. Easiest workaround: specify the types of your declarations explicitly.") - map.put(MUST_BE_INITIALIZED, "Property must be initialized") + map.put(MUST_BE_INITIALIZED, "Property must be initialized.") map.put(MUST_BE_INITIALIZED_WARNING, "Property must be initialized. This warning will become an error in future releases.") - map.put(MUST_BE_INITIALIZED_OR_BE_FINAL, "Property must be initialized or be final") + map.put(MUST_BE_INITIALIZED_OR_BE_FINAL, "Property must be initialized or be final.") map.put(MUST_BE_INITIALIZED_OR_BE_FINAL_WARNING, "Property must be initialized or be final. This warning will become an error in future releases.") - map.put(MUST_BE_INITIALIZED_OR_BE_ABSTRACT, "Property must be initialized or be abstract") + map.put(MUST_BE_INITIALIZED_OR_BE_ABSTRACT, "Property must be initialized or be abstract.") map.put(MUST_BE_INITIALIZED_OR_BE_ABSTRACT_WARNING, "Property must be initialized or be abstract. This warning will become an error in future releases.") - map.put(MUST_BE_INITIALIZED_OR_FINAL_OR_ABSTRACT, "Property must be initialized, be final, or be abstract") + map.put(MUST_BE_INITIALIZED_OR_FINAL_OR_ABSTRACT, "Property must be initialized, be final, or be abstract.") map.put(MUST_BE_INITIALIZED_OR_FINAL_OR_ABSTRACT_WARNING, "Property must be initialized, be final, or be abstract. This warning will become an error in future releases.") - map.put(EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT, "Extension property must have accessors or be abstract") - map.put(UNNECESSARY_LATEINIT, "Lateinit is unnecessary: definitely initialized in constructors") + map.put(EXTENSION_PROPERTY_MUST_HAVE_ACCESSORS_OR_BE_ABSTRACT, "Extension property must have accessors or be abstract.") + map.put(UNNECESSARY_LATEINIT, "'Lateinit' is unnecessary: definitely initialized in constructors.") - map.put(BACKING_FIELD_IN_INTERFACE, "Property in an interface cannot have a backing field") - map.put(EXTENSION_PROPERTY_WITH_BACKING_FIELD, "Extension property cannot be initialized because it has no backing field") - map.put(PROPERTY_INITIALIZER_NO_BACKING_FIELD, "Initializer is not allowed here because this property has no backing field") + map.put(BACKING_FIELD_IN_INTERFACE, "Property in interface cannot have a backing field.") + map.put(EXTENSION_PROPERTY_WITH_BACKING_FIELD, "Extension property cannot be initialized because it has no backing field.") + map.put(PROPERTY_INITIALIZER_NO_BACKING_FIELD, "Initializer is prohibited here because this property has no backing field.") - map.put(ABSTRACT_DELEGATED_PROPERTY, "Delegated property cannot be abstract") - map.put(DELEGATED_PROPERTY_IN_INTERFACE, "Delegated properties are not allowed in interfaces") + map.put(ABSTRACT_DELEGATED_PROPERTY, "Delegated property cannot be abstract.") + map.put(DELEGATED_PROPERTY_IN_INTERFACE, "Delegated properties in interfaces are prohibited.") - map.put(ABSTRACT_PROPERTY_WITH_GETTER, "Property with getter implementation cannot be abstract") - map.put(ABSTRACT_PROPERTY_WITH_SETTER, "Property with setter implementation cannot be abstract") - map.put(PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY, "Private setters are not allowed for abstract properties") - map.put(PRIVATE_SETTER_FOR_OPEN_PROPERTY, "Private setters are not allowed for open properties") - map.put(VAL_WITH_SETTER, "A 'val'-property cannot have a setter") + map.put(ABSTRACT_PROPERTY_WITH_GETTER, "Property with getter implementation cannot be abstract.") + map.put(ABSTRACT_PROPERTY_WITH_SETTER, "Property with setter implementation cannot be abstract.") + map.put(PRIVATE_SETTER_FOR_ABSTRACT_PROPERTY, "Private setters for abstract properties are prohibited.") + map.put(PRIVATE_SETTER_FOR_OPEN_PROPERTY, "Private setters for open properties are prohibited.") + map.put(VAL_WITH_SETTER, "A 'val' property cannot have a setter.") map.put( WRONG_SETTER_PARAMETER_TYPE, - "Setter parameter type must be equal to the type of the property, i.e. ''{0}''", + "Setter parameter type must be equal to the type of the property, i.e. ''{0}''.", RENDER_TYPE, RENDER_TYPE ) map.put( DELEGATE_USES_EXTENSION_PROPERTY_TYPE_PARAMETER, - "It''s forbidden to use the extension property type parameter ''{0}'' in delegate. See https://youtrack.jetbrains.com/issue/KT-24643", + "Extension property type parameter ''{0}'' cannot be used in delegates. See https://youtrack.jetbrains.com/issue/KT-24643.", SYMBOL ) - map.put(INITIALIZER_TYPE_MISMATCH, "Initializer type mismatch: expected ''{0}'', actual ''{1}''", RENDER_TYPE, RENDER_TYPE, NOT_RENDERED) - map.put(GETTER_VISIBILITY_DIFFERS_FROM_PROPERTY_VISIBILITY, "Getter visibility must be the same as property visibility") + map.put(INITIALIZER_TYPE_MISMATCH, "Initializer type mismatch: expected ''{0}'', actual ''{1}''.", RENDER_TYPE, RENDER_TYPE, NOT_RENDERED) + map.put(GETTER_VISIBILITY_DIFFERS_FROM_PROPERTY_VISIBILITY, "Getter visibility must be the same as property visibility.") map.put( SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY, - "Setter visibility must be the same or less permissive than property visibility" + "Setter visibility cannot be more permissive than property visibility." ) - map.put(WRONG_SETTER_RETURN_TYPE, "Setter return type must be Unit") + map.put(WRONG_SETTER_RETURN_TYPE, "Setter return type must be 'Unit'.") map.put( WRONG_GETTER_RETURN_TYPE, - "Getter return type must be equal to the type of the property, i.e. ''{0}''", + "Getter return type must be equal to the type of the property, i.e. ''{0}''.", RENDER_TYPE, RENDER_TYPE ) - map.put(ACCESSOR_FOR_DELEGATED_PROPERTY, "Delegated property cannot have accessors with non-default implementations") + map.put(ACCESSOR_FOR_DELEGATED_PROPERTY, "Delegated property cannot have accessors with non-default implementations.") map.put( PROPERTY_INITIALIZER_WITH_EXPLICIT_FIELD_DECLARATION, - "Property initializers are not allowed for properties with an explicit backing field declaration" + "Property initializers are prohibited for properties with explicit backing field declaration." ) map.put( PROPERTY_FIELD_DECLARATION_MISSING_INITIALIZER, - "Property backing field declaration must have an initializer" + "Property backing field declaration must have an initializer." ) map.put( LATEINIT_PROPERTY_FIELD_DECLARATION_WITH_INITIALIZER, - "Lateinit backing field cannot have an initializer" + "'lateinit' backing field cannot have an initializer." ) map.put( LATEINIT_FIELD_IN_VAL_PROPERTY, - "Only mutable properties can have a mutable backing field. Consider changing 'val' to 'var'" + "Only mutable properties can have a mutable backing field. Consider changing 'val' to 'var'." ) map.put( LATEINIT_NULLABLE_BACKING_FIELD, - "Lateinit modifier is not allowed on backing fields of a type with nullable upper bound" + "'lateinit' modifier is prohibited on backing fields of a type with nullable upper bound." ) map.put( BACKING_FIELD_FOR_DELEGATED_PROPERTY, - "Delegated properties can't have explicit backing field declarations" + "Delegated properties cannot have explicit backing field declarations." ) map.put( PROPERTY_MUST_HAVE_GETTER, - "This property needs a custom getter, because its type is not a supertype of the backing field's type" + "This property needs a custom getter, because its type is not a supertype of the backing field's type." ) map.put( PROPERTY_MUST_HAVE_SETTER, - "This property needs a custom setter, because its type is not a subtype of the backing field's type" + "This property needs a custom setter, because its type is not a subtype of the backing field's type." ) map.put( EXPLICIT_BACKING_FIELD_IN_INTERFACE, - "Backing fields are not allowed inside interfaces" + "Backing fields inside interfaces are prohibited." ) map.put( EXPLICIT_BACKING_FIELD_IN_ABSTRACT_PROPERTY, - "Abstract property cannot have a backing field" + "Abstract property cannot have a backing field." ) map.put( EXPLICIT_BACKING_FIELD_IN_EXTENSION, - "Extension properties cannot have a backing field" + "Extension properties cannot have a backing field." ) map.put( REDUNDANT_EXPLICIT_BACKING_FIELD, - "There's no need for an explicit backing field declaration if it has the same type as the property" + "Explicit backing field declaration is unnecessary if it has the same type as the property." ) - map.put(ABSTRACT_PROPERTY_IN_PRIMARY_CONSTRUCTOR_PARAMETERS, "Property in primary constructor cannot be declared abstract") - map.put(LOCAL_VARIABLE_WITH_TYPE_PARAMETERS_WARNING, "Type parameters for local variables are deprecated") - map.put(LOCAL_VARIABLE_WITH_TYPE_PARAMETERS, "Local variables are not allowed to have type parameters") - map.put(EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS, "A property access cannot have explicit type arguments") + map.put(ABSTRACT_PROPERTY_IN_PRIMARY_CONSTRUCTOR_PARAMETERS, "Property in primary constructor cannot be declared as abstract.") + map.put(LOCAL_VARIABLE_WITH_TYPE_PARAMETERS_WARNING, "Type parameters for local variables are deprecated.") + map.put(LOCAL_VARIABLE_WITH_TYPE_PARAMETERS, "Local variables cannot have type parameters.") + map.put(EXPLICIT_TYPE_ARGUMENTS_IN_PROPERTY_ACCESS, "Property access cannot have explicit type arguments.") - map.put(LATEINIT_INTRINSIC_CALL_ON_NON_LITERAL, "This declaration can only be called on a property literal (e.g. 'Foo::bar')") - map.put(LATEINIT_INTRINSIC_CALL_ON_NON_LATEINIT, "This declaration can only be called on a reference to a lateinit property") - map.put(LATEINIT_INTRINSIC_CALL_IN_INLINE_FUNCTION, "This declaration can not be used inside an inline function") - map.put(LATEINIT_INTRINSIC_CALL_ON_NON_ACCESSIBLE_PROPERTY, "Backing field of ''{0}'' is not accessible at this point", SYMBOL) + map.put(LATEINIT_INTRINSIC_CALL_ON_NON_LITERAL, "This declaration can only be called on a property literal (e.g. 'Foo::bar').") + map.put(LATEINIT_INTRINSIC_CALL_ON_NON_LATEINIT, "This declaration can only be called on a reference to a 'lateinit' property.") + map.put(LATEINIT_INTRINSIC_CALL_IN_INLINE_FUNCTION, "This declaration cannot be used inside an inline function.") + map.put(LATEINIT_INTRINSIC_CALL_ON_NON_ACCESSIBLE_PROPERTY, "Backing field of ''{0}'' is not accessible at this point.", SYMBOL) - map.put(LOCAL_EXTENSION_PROPERTY, "Local extension properties are not allowed") + map.put(LOCAL_EXTENSION_PROPERTY, "Local extension properties are prohibited.") - map.put(CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT, "Const 'val' is only allowed on top level, in named objects, or in companion objects") - map.put(CONST_VAL_WITH_GETTER, "Const 'val' should not have a getter") - map.put(CONST_VAL_WITH_DELEGATE, "Const 'val' should not have a delegate") - 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") - map.put(CYCLE_IN_ANNOTATION_PARAMETER, "Type of this parameter is cyclic") + map.put(CONST_VAL_NOT_TOP_LEVEL_OR_OBJECT, "Const 'val' is only allowed on top level, in named objects, or in companion objects.") + map.put(CONST_VAL_WITH_GETTER, "Const 'val' cannot have a getter.") + map.put(CONST_VAL_WITH_DELEGATE, "Const 'val' cannot have a delegate.") + map.put(TYPE_CANT_BE_USED_FOR_CONST_VAL, "Const ''val'' has type ''{0}''. Only primitive types and ''String'' are allowed.", RENDER_TYPE) + map.put(CONST_VAL_WITHOUT_INITIALIZER, "Const 'val' must 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.") + map.put(CYCLE_IN_ANNOTATION_PARAMETER, "Cycle formed by one or more annotations and their parameter types.") // Multi-platform projects - map.put(EXPECTED_DECLARATION_WITH_BODY, "Expected declaration must not have a body") - map.put(EXPECTED_CLASS_CONSTRUCTOR_DELEGATION_CALL, "Explicit delegation call for constructor of an expected class is not allowed") - map.put(EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER, "Expected class constructor cannot have a property parameter") - map.put(EXPECTED_ENUM_CONSTRUCTOR, "Expected enum class cannot have a constructor") - map.put(EXPECTED_ENUM_ENTRY_WITH_BODY, "Expected enum entry cannot have a body") - map.put(EXPECTED_PROPERTY_INITIALIZER, "Expected property cannot have an initializer") - map.put(EXPECTED_DELEGATED_PROPERTY, "Expected property cannot be delegated") - map.put(EXPECTED_LATEINIT_PROPERTY, "Expected property cannot be lateinit") - map.put(EXPECTED_PRIVATE_DECLARATION, "Expected declaration cannot be private") - map.put(EXPECTED_EXTERNAL_DECLARATION, "Expected declaration cannot be external") - map.put(EXPECTED_TAILREC_FUNCTION, "Expected function cannot have 'tailrec' modifier") - map.put(SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS, "Expected classes cannot initialize supertypes") - map.put(IMPLEMENTATION_BY_DELEGATION_IN_EXPECT_CLASS, "Implementation by delegation in expected classes is prohibited") - map.put(ACTUAL_TYPE_ALIAS_NOT_TO_CLASS, "Right-hand side of actual type alias should be a class, not another type alias") + map.put(EXPECTED_DECLARATION_WITH_BODY, "Expected declaration cannot have a body.") + map.put(EXPECTED_CLASS_CONSTRUCTOR_DELEGATION_CALL, "Explicit delegation call for constructor of expected class is prohibited.") + map.put(EXPECTED_CLASS_CONSTRUCTOR_PROPERTY_PARAMETER, "Expected class constructor cannot have a property parameter.") + map.put(EXPECTED_ENUM_CONSTRUCTOR, "Expected enum class cannot have a constructor.") + map.put(EXPECTED_ENUM_ENTRY_WITH_BODY, "Expected enum entry cannot have a body.") + map.put(EXPECTED_PROPERTY_INITIALIZER, "Expected property cannot have an initializer.") + map.put(EXPECTED_DELEGATED_PROPERTY, "Expected property cannot be delegated.") + map.put(EXPECTED_LATEINIT_PROPERTY, "Expected property cannot be 'lateinit'.") + map.put(EXPECTED_PRIVATE_DECLARATION, "Expected declaration cannot be private.") + map.put(EXPECTED_EXTERNAL_DECLARATION, "Expected declaration cannot be external.") + map.put(EXPECTED_TAILREC_FUNCTION, "Expected function cannot have 'tailrec' modifier.") + map.put(SUPERTYPE_INITIALIZED_IN_EXPECTED_CLASS, "Expected classes cannot initialize supertypes.") + map.put(IMPLEMENTATION_BY_DELEGATION_IN_EXPECT_CLASS, "Implementation by delegation in expected classes is prohibited.") + map.put(ACTUAL_TYPE_ALIAS_NOT_TO_CLASS, "Right-hand side of actual type alias should be a class, not another type alias.") map.put( ACTUAL_TYPE_ALIAS_TO_CLASS_WITH_DECLARATION_SITE_VARIANCE, - "Aliased class should not have type parameters with declaration-site variance" + "Aliased class should not have type parameters with declaration-site variance." ) map.put( ACTUAL_TYPE_ALIAS_WITH_USE_SITE_VARIANCE, - "Right-hand side of actual type alias cannot contain use-site variance or star projections" + "Right-hand side of actual type alias cannot contain use-site variance or star projections." ) map.put( ACTUAL_TYPE_ALIAS_WITH_COMPLEX_SUBSTITUTION, - "Type arguments in the right-hand side of actual type alias should be its type parameters in the same order, e.g. 'actual typealias Foo = Bar'" + "Type arguments in the right-hand side of actual type alias should be its type parameters in the same order, e.g. 'actual typealias Foo = Bar'." ) map.put( ACTUAL_TYPE_ALIAS_TO_NULLABLE_TYPE, @@ -1887,7 +1887,7 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( ACTUAL_FUNCTION_WITH_DEFAULT_ARGUMENTS, - "Actual function cannot have default argument values, they should be declared in the expected function" + "Actual function cannot have default argument values. They should be declared in the expected function." ) map.put( DEFAULT_ARGUMENTS_IN_EXPECT_WITH_ACTUAL_TYPEALIAS, @@ -1898,46 +1898,46 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( ACTUAL_ANNOTATION_CONFLICTING_DEFAULT_ARGUMENT_VALUE, - "Parameter ''{0}'' has conflicting values in the expected and actual annotation", + "Parameter ''{0}'' has conflicting values in expected and actual annotations.", SYMBOL ) map.put( EXPECTED_FUNCTION_SOURCE_WITH_DEFAULT_ARGUMENTS_NOT_FOUND, - "Expected function source is not found, therefore it's impossible to generate default argument values declared there. Please add the corresponding file to compilation sources" + "Expected function source is not found, so generating default argument values declared there is impossible. Please add the corresponding file to compilation sources." ) map.put( NO_ACTUAL_FOR_EXPECT, - "Expected {0} has no actual declaration in module {1}{2}", + "Expected ''{0}'' has no actual declaration in ''{1}''{2}.", SYMBOL, MODULE_DATA, FirPlatformIncompatibilityDiagnosticRenderer.TEXT ) map.put( ACTUAL_WITHOUT_EXPECT, - "{0} has no corresponding expected declaration{1}", + "''{0}'' has no corresponding expected declaration{1}", SYMBOL, FirPlatformIncompatibilityDiagnosticRenderer.TEXT ) - map.put(AMBIGUOUS_ACTUALS, "{0} has several compatible actual declarations in modules {1}", SYMBOL, SYMBOLS) - map.put(AMBIGUOUS_EXPECTS, "{0} has several compatible expect declarations in modules {1}", SYMBOL, COLLECTION(MODULE_DATA)) + map.put(AMBIGUOUS_ACTUALS, "''{0}'' has several compatible actual declarations in modules {1}.", SYMBOL, SYMBOLS) + map.put(AMBIGUOUS_EXPECTS, "''{0}'' has several compatible expect declarations in modules {1}.", SYMBOL, COLLECTION(MODULE_DATA)) map.put( NO_ACTUAL_CLASS_MEMBER_FOR_EXPECTED_CLASS, "Actual class ''{0}'' has no corresponding members for expected class members:{1}", SYMBOL, FirIncompatibleExpectedActualClassScopesRenderer.TEXT ) - map.put(ACTUAL_MISSING, "Declaration must be marked with 'actual'") + map.put(ACTUAL_MISSING, "Declaration must be marked with 'actual'.") map.put(NOT_A_MULTIPLATFORM_COMPILATION, "'expect' and 'actual' declarations can be used only in multiplatform projects. Learn more about Kotlin Multiplatform: https://kotl.in/multiplatform-setup") - map.put(EXPECT_ACTUAL_OPT_IN_ANNOTATION, "Opt-in annotations are prohibited to be `expect` or `actual`. Instead, declare annotation once in common sources.") + map.put(EXPECT_ACTUAL_OPT_IN_ANNOTATION, "Opt-in annotations are prohibited to be 'expect' or 'actual'. Instead, declare annotation once in common sources.") map.put( ACTUAL_TYPEALIAS_TO_SPECIAL_ANNOTATION, - "`actual typealias` to annotation which affects code compilation can lead to incorrect behavior. Instead, use ''{0}'' annotation directly.", + "''actual typealias'' to annotation which affects code compilation can lead to incorrect behavior. Instead, use ''{0}'' annotation directly.", TO_STRING ) map.put( ACTUAL_ANNOTATIONS_NOT_MATCH_EXPECT, "{2}.\n" + - "All annotations from expect `{0}` must be present with the same arguments on actual `{1}`, otherwise they might behave incorrectly.", + "All annotations from expect ''{0}'' must be present with the same arguments on actual ''{1}'', otherwise they might behave incorrectly.", FirExpectActualAnnotationIncompatibilityDiagnosticRenderers.SYMBOL_RENDERER, FirExpectActualAnnotationIncompatibilityDiagnosticRenderers.SYMBOL_RENDERER, FirExpectActualAnnotationIncompatibilityDiagnosticRenderers.INCOMPATIBILITY, @@ -1956,69 +1956,69 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) // Destructuring declaration - map.put(INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION, "Initializer required for destructuring declaration") + map.put(INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION, "Initializer required for destructuring declaration.") map.put( COMPONENT_FUNCTION_MISSING, - "Destructuring declaration initializer of type ''{1}'' must have a ''{0}()'' function", + "Destructuring of type ''{1}'' requires operator function ''{0}()''.", TO_STRING, RENDER_TYPE ) map.put( COMPONENT_FUNCTION_AMBIGUITY, - "Function ''{0}''() is ambiguous for this expression: {1}", + "Function ''{0}()'' is ambiguous for this expression: {1}.", TO_STRING, AMBIGUOUS_CALLS ) map.put( COMPONENT_FUNCTION_ON_NULLABLE, - "Not nullable value required to call ''{0}()'' function of destructuring declaration initializer", + "Non-nullable value required to call ''{0}()'' function of destructuring declaration initializer.", TO_STRING ) map.put( COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH, - "''{0}()'' function returns ''{1}'', but ''{2}'' is expected", + "Function ''{0}()'' returns ''{1}'', but ''{2}'' is expected.", TO_STRING, RENDER_TYPE, RENDER_TYPE ) // Control flow diagnostics - map.put(UNINITIALIZED_VARIABLE, "Variable ''{0}'' must be initialized", VARIABLE_NAME) - map.put(UNINITIALIZED_PARAMETER, "Parameter ''{0}'' is uninitialized here", VARIABLE_NAME) - map.put(UNINITIALIZED_ENUM_ENTRY, "Enum entry ''{0}'' is uninitialized here", VARIABLE_NAME) - map.put(UNINITIALIZED_ENUM_COMPANION, "Companion object of enum class ''{0}'' is uninitialized here", SYMBOL) - map.put(VAL_REASSIGNMENT, "Val cannot be reassigned", VARIABLE_NAME) - map.put(VAL_REASSIGNMENT_VIA_BACKING_FIELD, "Reassignment of read-only property via backing field", VARIABLE_NAME) + map.put(UNINITIALIZED_VARIABLE, "Variable ''{0}'' must be initialized.", VARIABLE_NAME) + map.put(UNINITIALIZED_PARAMETER, "Parameter ''{0}'' is uninitialized here.", VARIABLE_NAME) + map.put(UNINITIALIZED_ENUM_ENTRY, "Enum entry ''{0}'' is uninitialized here.", VARIABLE_NAME) + map.put(UNINITIALIZED_ENUM_COMPANION, "Companion object of enum class ''{0}'' is uninitialized here.", SYMBOL) + map.put(VAL_REASSIGNMENT, "''val'' cannot be reassigned.", VARIABLE_NAME) + map.put(VAL_REASSIGNMENT_VIA_BACKING_FIELD, "Reassignment of read-only property via backing field.", VARIABLE_NAME) map.put( CAPTURED_VAL_INITIALIZATION, - "Captured values initialization is forbidden due to possible reassignment", + "Captured values cannot be initialized because of possible reassignments.", VARIABLE_NAME ) map.put( CAPTURED_MEMBER_VAL_INITIALIZATION, - "Captured member values initialization is forbidden due to possible reassignment", + "Initialization of captured member values is prohibited because of possible reassignments.", VARIABLE_NAME ) map.put( SETTER_PROJECTED_OUT, - "Setter for ''{0}'' is removed by type projection", + "Setter for ''{0}'' is removed by type projection.", VARIABLE_NAME ) map.put( WRONG_INVOCATION_KIND, - "{0} has wrong invocation kind: given {1} case, but {2} case is possible", + "Wrong invocation kind ''{1}'' for ''{0}'' specified, the actual invocation kind is ''{2}''.", SYMBOL, TO_STRING, TO_STRING ) - map.put(LEAKED_IN_PLACE_LAMBDA, "Leaked in-place lambda: {0}", SYMBOL) - map.put(FirErrors.WRONG_IMPLIES_CONDITION, "Wrong implies condition") - map.put(UNREACHABLE_CODE, "Unreachable code", NOT_RENDERED, NOT_RENDERED) - map.put(SENSELESS_COMPARISON, "Condition is always ''{0}''", TO_STRING) - map.put(SENSELESS_NULL_IN_WHEN, "Expression under 'when' is never equal to null") + map.put(LEAKED_IN_PLACE_LAMBDA, "Leaked in-place lambda ''{0}''.", SYMBOL) + map.put(FirErrors.WRONG_IMPLIES_CONDITION, "Wrong 'implies' condition.") + map.put(UNREACHABLE_CODE, "Unreachable code.", NOT_RENDERED, NOT_RENDERED) + map.put(SENSELESS_COMPARISON, "Condition is always ''{0}''.", TO_STRING) + map.put(SENSELESS_NULL_IN_WHEN, "Expression under 'when' is never equal to null.") // Nullability - map.put(USELESS_CALL_ON_NOT_NULL, "Unsafe call on not null") + map.put(USELESS_CALL_ON_NOT_NULL, "Unnecessary call on a non-null value.") map.put( UNSAFE_CALL, "Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type ''{0}''.", @@ -2027,12 +2027,12 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( UNSAFE_IMPLICIT_INVOKE_CALL, - "Reference has a nullable type ''{0}'', use explicit ''?.invoke'' to make a function-like call instead.", + "Reference has a nullable type ''{0}''. Use explicit ''?.invoke'' to make a function-like call instead.", RENDER_TYPE ) map.put( UNSAFE_INFIX_CALL, - "Infix call is not allowed on a nullable receiver of type ''{0}''. Use ''?.''-qualified call instead.", + "Infix call is prohibited on a nullable receiver of type ''{0}''. Use ''?.''-qualified call instead.", RENDER_TYPE, NOT_RENDERED, NOT_RENDERED, @@ -2040,87 +2040,87 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( UNSAFE_OPERATOR_CALL, - "Operator call is not allowed on a nullable receiver of type ''{0}''. Use ''?.''-qualified call instead.", + "Operator call is prohibited on a nullable receiver of type ''{0}''. Use ''?.''-qualified call instead.", RENDER_TYPE, NOT_RENDERED, NOT_RENDERED, NOT_RENDERED, ) - map.put(UNNECESSARY_NOT_NULL_ASSERTION, "Unnecessary non-null assertion (!!) on a non-null receiver of type ''{0}''", RENDER_TYPE) - map.put(NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION, "Non-null assertion (!!) is called on a lambda expression") - map.put(NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE, "Non-null assertion (!!) is called on a callable reference expression") - map.put(UNNECESSARY_SAFE_CALL, "Unnecessary safe call on a non-null receiver of type ''{0}''", RENDER_TYPE) + map.put(UNNECESSARY_NOT_NULL_ASSERTION, "Unnecessary non-null assertion (!!) on a non-null receiver of type ''{0}''.", RENDER_TYPE) + map.put(NOT_NULL_ASSERTION_ON_LAMBDA_EXPRESSION, "Non-null assertion (!!) called on a lambda expression.") + map.put(NOT_NULL_ASSERTION_ON_CALLABLE_REFERENCE, "Non-null assertion (!!) called on a callable reference expression.") + map.put(UNNECESSARY_SAFE_CALL, "Unnecessary safe call on a non-null receiver of type ''{0}''.", RENDER_TYPE) map.put( SAFE_CALL_WILL_CHANGE_NULLABILITY, """ - |Safe call on a non-null receiver will have nullable type in future releases - | Right now safe call on non-nullable receiver has not null type: SomeType - | In future releases all safe calls will have nullable type: SomeType?""".trimMargin() + |Safe call on a non-null receiver will have nullable type in future releases. + |Safe call on non-nullable receiver has a non-null type: SomeType. + |In future releases all safe calls will have nullable type: SomeType?""".trimMargin() ) - map.put(UNEXPECTED_SAFE_CALL, "Safe-call is not allowed here") - map.put(USELESS_ELVIS, "Elvis operator (?:) always returns the left operand of non-nullable type ''{0}''", RENDER_TYPE) - map.put(USELESS_ELVIS_RIGHT_IS_NULL, "Right operand of elvis operator (?:) is useless if it is null") + map.put(UNEXPECTED_SAFE_CALL, "Safe call is prohibited here.") + map.put(USELESS_ELVIS, "Elvis operator (?:) always returns the left operand of non-nullable type ''{0}''.", RENDER_TYPE) + map.put(USELESS_ELVIS_RIGHT_IS_NULL, "Right operand of elvis operator (?:) is useless if it is null.") // Casts and is-checks - map.put(CANNOT_CHECK_FOR_ERASED, "Cannot check for instance of erased type: ''{0}''", RENDER_TYPE) - map.put(CAST_NEVER_SUCCEEDS, "This cast can never succeed") - map.put(USELESS_CAST, "No cast needed") - map.put(UNCHECKED_CAST, "Unchecked cast: ''{0}'' to ''{1}''", RENDER_TYPE, RENDER_TYPE) - map.put(USELESS_IS_CHECK, "Check for instance is always ''{0}''", TO_STRING) - map.put(DYNAMIC_NOT_ALLOWED, "Dynamic types are not allowed in this position") - map.put(IS_ENUM_ENTRY, "'is' over enum entry is not allowed, use comparison instead") - map.put(ENUM_ENTRY_AS_TYPE, "Use of enum entry names as types is not allowed, use enum type instead") + map.put(CANNOT_CHECK_FOR_ERASED, "Cannot check for instance of erased type ''{0}''.", RENDER_TYPE) + map.put(CAST_NEVER_SUCCEEDS, "This cast can never succeed.") + map.put(USELESS_CAST, "No cast needed.") + map.put(UNCHECKED_CAST, "Unchecked cast of ''{0}'' to ''{1}''.", RENDER_TYPE, RENDER_TYPE) + map.put(USELESS_IS_CHECK, "Check for instance is always ''{0}''.", TO_STRING) + map.put(DYNAMIC_NOT_ALLOWED, "Dynamic types are not allowed in this position.") + map.put(IS_ENUM_ENTRY, "'is' over enum entry is prohibited. Use comparison instead.") + map.put(ENUM_ENTRY_AS_TYPE, "Use of enum entry names as types is prohibited. Use enum type instead.") // When expressions - map.put(EXPECTED_CONDITION, "Expected condition of type Boolean") - map.put(NO_ELSE_IN_WHEN, "''when'' expression must be exhaustive, add necessary {0}{1}", WHEN_MISSING_CASES, STRING) - map.put(INVALID_IF_AS_EXPRESSION, "'if' must have both main and 'else' branches if used as an expression") + map.put(EXPECTED_CONDITION, "Condition of type 'Boolean' expected.") + map.put(NO_ELSE_IN_WHEN, "''when'' expression must be exhaustive. Add the necessary {0}{1}", WHEN_MISSING_CASES, STRING) + map.put(INVALID_IF_AS_EXPRESSION, "'if' must have both main and 'else' branches when used as an expression.") map.put( NON_EXHAUSTIVE_WHEN_STATEMENT, - "Non-exhaustive ''when'' statements on {0} will be prohibited in 1.7, add {1}", + "Non-exhaustive ''when'' statements on ''{0}'' will be prohibited in 1.7. Add ''{1}''.", TO_STRING, WHEN_MISSING_CASES ) - map.put(ELSE_MISPLACED_IN_WHEN, "'else' entry must be the last one in a when-expression") + 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" + "Use '||' instead of commas in conditions of 'when' without a subject." ) - map.put(DUPLICATE_LABEL_IN_WHEN, "Duplicate label in when") + map.put(DUPLICATE_LABEL_IN_WHEN, "Duplicate label in 'when'.") map.put( ILLEGAL_DECLARATION_IN_WHEN_SUBJECT, - "Illegal variable declaration in ''when'' subject: {0}. Should be a simple val with an initializer", + "Illegal variable declaration in ''when'' subject: {0}. Should be a simple ''val'' with an initializer.", STRING ) map.put( CONFUSING_BRANCH_CONDITION, - "The logical expressions may be understood ambiguously in when with subject branches. Please wrap it with parentheses" + "Logical expression in when-with-subject. The branch will be matched by comparing the result of the logical expression with the subject. To suppress the diagnostic, wrap the expression with parentheses." ) // Context tracking - map.put(TYPE_PARAMETER_IS_NOT_AN_EXPRESSION, "Type parameter ''{0}'' is not an expression", SYMBOL) + map.put(TYPE_PARAMETER_IS_NOT_AN_EXPRESSION, "Type parameter ''{0}'' is not an expression.", SYMBOL) map.put( TYPE_PARAMETER_ON_LHS_OF_DOT, - "Type parameter ''{0}'' cannot have or inherit a companion object, so it cannot be on the left-hand side of dot", + "Type parameter ''{0}'' cannot have or inherit a companion object, so it cannot be on the left-hand side of a dot.", SYMBOL ) map.put( NO_COMPANION_OBJECT, - "Classifier ''{0}'' does not have a companion object, and thus must be initialized here", + "Classifier ''{0}'' does not have a companion object, so it cannot be used as an expression.", SYMBOL ) - map.put(EXPRESSION_EXPECTED_PACKAGE_FOUND, "Expression expected, but a package name found") + map.put(EXPRESSION_EXPECTED_PACKAGE_FOUND, "Expression expected, but package name found.") // Function contracts - map.put(ERROR_IN_CONTRACT_DESCRIPTION, "Error in contract description", TO_STRING) + map.put(ERROR_IN_CONTRACT_DESCRIPTION, "Error in contract description.", TO_STRING) map.put(CONTRACT_NOT_ALLOWED, "{0}", TO_STRING) // Conventions - map.put(NO_GET_METHOD, "No get method providing array access") - map.put(NO_SET_METHOD, "No set method providing array access") + map.put(NO_GET_METHOD, "No 'get' operator method providing array access.") + map.put(NO_SET_METHOD, "No 'set' operator method providing array access.") map.put( DELEGATE_SPECIAL_FUNCTION_MISSING, - "Type ''{1}'' has no method ''{0}'' and thus it cannot serve as a {2}", + "Type ''{1}'' has no method ''{0}'', so it cannot serve as a {2}.", TO_STRING, RENDER_TYPE, TO_STRING @@ -2139,172 +2139,171 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, - "The ''{0}'' function of property delegate is expected to return ''{1}'', but returns ''{2}''", + "Function ''{0}'' of property delegate is expected to return ''{1}'', but returns ''{2}''.", TO_STRING, RENDER_TYPE, RENDER_TYPE, ) map.put( UNDERSCORE_IS_RESERVED, - "Names _, __, ___, ..., are reserved in Kotlin" + "Names _, __, ___, ... are reserved in Kotlin." ) map.put( UNDERSCORE_USAGE_WITHOUT_BACKTICKS, - "Names _, __, ___, ... can only be used in back-ticks (`_`, `__`, `___`, ...)" + "Names _, __, ___, ... can only be used in back-ticks (`_`, `__`, `___`, ...)." ) map.put( RESOLVED_TO_UNDERSCORE_NAMED_CATCH_PARAMETER, - "Referencing to an underscore-named parameter is deprecated. It will be an error in a future release." + "Referencing an underscore-named parameter is deprecated. It will be an error in a future release." ) map.put( INVALID_CHARACTERS, - "Name {0}", + "Name {0}.", STRING ) map.put( DANGEROUS_CHARACTERS, - "Name contains characters which can cause problems on Windows: {0}", + "Name contains character(s) that can cause problems on Windows: {0}", STRING ) map.put( EQUALITY_NOT_APPLICABLE, - "Operator ''{0}'' cannot be applied to ''{1}'' and ''{2}''", + "Operator ''{0}'' cannot be applied to ''{1}'' and ''{2}''.", TO_STRING, RENDER_TYPE, RENDER_TYPE ) map.put( EQUALITY_NOT_APPLICABLE_WARNING, - "Comparing with ''{0}'' may not be intended because ''{1}'' and ''{2}'' are incompatible types", + "Comparison with ''{0}'' might not be intended because ''{1}'' and ''{2}'' are incompatible types.", TO_STRING, RENDER_TYPE, RENDER_TYPE ) map.put( INCOMPATIBLE_ENUM_COMPARISON_ERROR, - "Comparison of incompatible enums ''{0}'' and ''{1}'' is always unsuccessful", + "Comparison of incompatible enums ''{0}'' and ''{1}'' is always unsuccessful.", RENDER_TYPE, RENDER_TYPE ) map.put( INCOMPATIBLE_ENUM_COMPARISON, - "Comparison of incompatible enums ''{0}'' and ''{1}'' is always unsuccessful", + "Comparison of incompatible enums ''{0}'' and ''{1}'' is always unsuccessful.", RENDER_TYPE, RENDER_TYPE ) map.put( FORBIDDEN_IDENTITY_EQUALS, - "Identity equality for arguments of types ''{0}'' and ''{1}'' is forbidden", + "Identity equality for arguments of types ''{0}'' and ''{1}'' is prohibited.", RENDER_TYPE, RENDER_TYPE ) map.put( FORBIDDEN_IDENTITY_EQUALS_WARNING, - "Identity equality for arguments of types ''{0}'' and ''{1}'' is forbidden", + "Identity equality for arguments of types ''{0}'' and ''{1}'' is prohibited.", RENDER_TYPE, RENDER_TYPE ) map.put( DEPRECATED_IDENTITY_EQUALS, - "Identity equality for arguments of types ''{0}'' and ''{1}'' is deprecated", + "Identity equality for arguments of types ''{0}'' and ''{1}'' is deprecated.", RENDER_TYPE, RENDER_TYPE ) map.put( IMPLICIT_BOXING_IN_IDENTITY_EQUALS, - "Identity equality for arguments of types ''{0}'' and ''{1}'' can be unstable because of implicit boxing", + "Identity equality for arguments of types ''{0}'' and ''{1}'' can be unstable because of implicit boxing.", RENDER_TYPE, RENDER_TYPE ) - map.put(INC_DEC_SHOULD_NOT_RETURN_UNIT, "Functions inc(), dec() shouldn't return Unit to be used by operators ++, --") + map.put(INC_DEC_SHOULD_NOT_RETURN_UNIT, "Functions 'inc()', 'dec()' shouldn't return 'Unit' to be used by operators ++, --.") map.put( ASSIGNMENT_OPERATOR_SHOULD_RETURN_UNIT, - "Function ''{0}'' should return Unit to be used by corresponding operator ''{1}''", + "Function ''{0}'' should return ''Unit'' to be used by corresponding operator ''{1}''.", SYMBOL, TO_STRING ) map.put( PROPERTY_AS_OPERATOR, - "Property ''{0}'' cannot be used as an operator.", + "Property ''{0}'' cannot be used as operator.", SYMBOL ) map.put( DSL_SCOPE_VIOLATION, - "''{0}'' can''t be called in this context by implicit receiver. " + - "Use the explicit one if necessary", + "''{0}'' cannot be called in this context by implicit receiver. Use the explicit one if necessary.", SYMBOL ) // Type alias - map.put(TOPLEVEL_TYPEALIASES_ONLY, "Nested and local type aliases are not supported") - map.put(RECURSIVE_TYPEALIAS_EXPANSION, "Recursive type alias in expansion") + map.put(TOPLEVEL_TYPEALIASES_ONLY, "Nested and local type aliases are not supported.") + map.put(RECURSIVE_TYPEALIAS_EXPANSION, "Recursive type alias in expansion.") map.put( TYPEALIAS_SHOULD_EXPAND_TO_CLASS, - "Type alias expands to ''{0}'', which is not a class, an interface, or an object", + "Type alias expands to ''{0}'', which is not a class, interface, or object.", RENDER_TYPE ) // Returns - map.put(RETURN_NOT_ALLOWED, "'return' is not allowed here") - map.put(NOT_A_FUNCTION_LABEL, "Target label does not denote a function") + map.put(RETURN_NOT_ALLOWED, "'return' is prohibited here.") + map.put(NOT_A_FUNCTION_LABEL, "Target label does not denote a function.") map.put( RETURN_IN_FUNCTION_WITH_EXPRESSION_BODY, - "Returns are not allowed for functions with expression body. Use block body in '{...}'" + "Returns are prohibited for functions with an expression body. Use block body '{...}'." ) - map.put(ANONYMOUS_INITIALIZER_IN_INTERFACE, "Anonymous initializers are not allowed in interfaces") + map.put(ANONYMOUS_INITIALIZER_IN_INTERFACE, "Anonymous initializers in interfaces are prohibited.") // Inline map.put( USAGE_IS_NOT_INLINABLE, - "Illegal usage of inline-parameter ''{0}''. Add ''noinline'' modifier to the parameter declaration", + "Illegal usage of inline parameter ''{0}''. Add ''noinline'' modifier to the parameter declaration.", SYMBOL ) map.put( NON_LOCAL_RETURN_NOT_ALLOWED, - "Can''t inline ''{0}'' here: it may contain non-local returns. Add ''crossinline'' modifier to parameter declaration ''{0}''", + "Cannot inline ''{0}'' here: it might contain non-local returns. Add ''crossinline'' modifier to parameter declaration ''{0}''.", SYMBOL ) - map.put(RECURSION_IN_INLINE, "Inline function ''{0}'' cannot be recursive", SYMBOL) - map.put(NON_PUBLIC_CALL_FROM_PUBLIC_INLINE, "Public-API inline function cannot access non-public-API ''{0}''", SYMBOL, SYMBOL) + map.put(RECURSION_IN_INLINE, "Inline function ''{0}'' cannot be recursive.", SYMBOL) + map.put(NON_PUBLIC_CALL_FROM_PUBLIC_INLINE, "Public-API inline function cannot access non-public-API ''{0}''.", SYMBOL, SYMBOL) map.put( PROTECTED_CONSTRUCTOR_CALL_FROM_PUBLIC_INLINE, - "Protected constructor call from public-API inline function is deprecated", + "Protected constructor call from public-API inline function is deprecated.", SYMBOL, SYMBOL ) map.put( PROTECTED_CALL_FROM_PUBLIC_INLINE, - "Protected function call from public-API inline function is deprecated", + "Protected function call from public-API inline function is deprecated.", SYMBOL, SYMBOL ) map.put( PROTECTED_CALL_FROM_PUBLIC_INLINE_ERROR, - "Protected function call from public-API inline function is prohibited", + "Protected function call from public-API inline function is prohibited.", SYMBOL, SYMBOL ) map.put( PRIVATE_CLASS_MEMBER_FROM_INLINE, - "Non-private inline function ''{1}'' cannot access members of private classes: ''{0}''", + "Non-private inline function ''{1}'' cannot access members of private class ''{0}''.", SYMBOL, SYMBOL ) - map.put(NOT_YET_SUPPORTED_IN_INLINE, "{0} are not yet supported in inline functions", STRING) + map.put(NOT_YET_SUPPORTED_IN_INLINE, "{0} are not yet supported in inline functions.", STRING) map.put( NOTHING_TO_INLINE, - "Expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of functional types" + "Expected performance impact from inlining is insignificant. Inlining works best for functions with parameters of function 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", + "Inline parameter ''{0}'' of ''{1}'' must not be nullable. Add ''noinline'' modifier to the parameter declaration or make its type not nullable.", SYMBOL, SYMBOL ) - map.put(SUPER_CALL_FROM_PUBLIC_INLINE, "Accessing super members from public-API inline function is deprecated", SYMBOL) + map.put(SUPER_CALL_FROM_PUBLIC_INLINE, "Accessing super members from public-API inline function is deprecated.", SYMBOL) - map.put(ILLEGAL_INLINE_PARAMETER_MODIFIER, "Modifier is only allowed for function parameters of an inline function") + map.put(ILLEGAL_INLINE_PARAMETER_MODIFIER, "Modifier is only allowed for function parameters of an inline function.") map.put( INLINE_SUSPEND_FUNCTION_TYPE_UNSUPPORTED, @@ -2313,59 +2312,59 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { map.put( INEFFICIENT_EQUALS_OVERRIDING_IN_VALUE_CLASS, - "Overriding ''equals'' from ''Any'' in value class without operator ''equals(other: {0}): Boolean'' leads to boxing on every equality comparison", + "Overriding ''equals'' from ''Any'' in value class without operator ''equals(other: {0}): Boolean'' leads to boxing on every equality comparison.", RENDER_TYPE ) //imports map.put( CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON, - "Cannot import-on-demand from object ''{0}''", + "Cannot import on demand from object ''{0}''.", TO_STRING ) - map.put(PACKAGE_CANNOT_BE_IMPORTED, "Packages cannot be imported") + map.put(PACKAGE_CANNOT_BE_IMPORTED, "Packages cannot be imported.") map.put( CANNOT_BE_IMPORTED, - "Cannot import ''{0}'', functions and properties can only be imported from packages or objects", + "Cannot import ''{0}''. Functions and properties can only be imported from packages or objects.", TO_STRING ) map.put( CONFLICTING_IMPORT, - "Conflicting import, imported name ''{0}'' is ambiguous", + "Conflicting import: imported name ''{0}'' is ambiguous.", TO_STRING ) - map.put(OPERATOR_RENAMED_ON_IMPORT, "Operator renamed to a different operator on import") + map.put(OPERATOR_RENAMED_ON_IMPORT, "Operator renamed to a different operator on import.") // Suspend map.put( ILLEGAL_SUSPEND_FUNCTION_CALL, - "Suspend function ''{0}'' should only be called from a coroutine or another suspend function", + "Suspend function ''{0}'' should be called only from a coroutine or another suspend function.", SYMBOL ) map.put( ILLEGAL_SUSPEND_PROPERTY_ACCESS, - "Suspend property ''{0}'' should only be accessed from a coroutine or suspend function", + "Suspend property ''{0}'' should be accessed only from a coroutine or suspend function.", SYMBOL ) - map.put(NON_LOCAL_SUSPENSION_POINT, "Suspension functions can only be called within coroutine body") + map.put(NON_LOCAL_SUSPENSION_POINT, "Suspension functions can only be called within coroutine body.") map.put( ILLEGAL_RESTRICTED_SUSPENDING_FUNCTION_CALL, - "Restricted suspending functions can only invoke member or extension suspending functions on their restricted coroutine scope" + "Restricted suspending functions can invoke member or extension suspending functions only on their restricted coroutine scope." ) map.put( NON_MODIFIER_FORM_FOR_BUILT_IN_SUSPEND, - "'suspend' function can only be called in a form of modifier of a lambda: suspend { ... }" + "'suspend' function can only be called in the form of a modifier of a lambda: suspend { ... }." ) map.put( MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND, - "Calls having a form of 'suspend {}' are deprecated because 'suspend' in the context will have a meaning of a modifier. Surround the lambda with parentheses: 'suspend({ ... })'" + "Calls in the form of 'suspend {}' are deprecated because 'suspend' in this context will have the meaning of a modifier. Surround the lambda with parentheses: 'suspend({ ... })'." ) map.put( MODIFIER_FORM_FOR_NON_BUILT_IN_SUSPEND_FUN, - "Calls having a form of 'suspend fun' are deprecated because 'suspend' in the context will have a meaning of a modifier. Surround the argument of the call with parens: 'suspend(fun() { ... })'." + + "Calls in the form of 'suspend fun' are deprecated because 'suspend' in the context will have the meaning of a modifier. Surround the argument of the call with parentheses: 'suspend(fun() { ... })'." + " See https://youtrack.jetbrains.com/issue/KT-49264" ) - map.put(RETURN_FOR_BUILT_IN_SUSPEND, "Using implicit label for this lambda is prohibited") + map.put(RETURN_FOR_BUILT_IN_SUSPEND, "Using implicit label for this lambda is prohibited.") map.put(MIXING_SUSPEND_AND_NON_SUSPEND_SUPERTYPES, "Mixing suspend and non-suspend supertypes is not allowed") map.put( MIXING_FUNCTIONAL_KINDS_IN_SUPERTYPES, @@ -2376,25 +2375,25 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { // Label map.put( REDUNDANT_LABEL_WARNING, - "Label is redundant, because it can not be referenced in either 'break', 'continue', or 'return' expression" + "Label is redundant, because it cannot be referenced in a 'break', 'continue', or 'return' expression." ) // Extended checkers group - map.put(REDUNDANT_VISIBILITY_MODIFIER, "Redundant visibility modifier") - map.put(REDUNDANT_MODALITY_MODIFIER, "Redundant modality modifier") - map.put(REDUNDANT_RETURN_UNIT_TYPE, "Redundant return 'unit' type") - map.put(REDUNDANT_EXPLICIT_TYPE, "Redundant explicit type") - map.put(REDUNDANT_SINGLE_EXPRESSION_STRING_TEMPLATE, "Redundant string template") - map.put(CAN_BE_VAL, "'var' can be 'val'") - map.put(CAN_BE_REPLACED_WITH_OPERATOR_ASSIGNMENT, "Assignment can be replaced with operator assignment") - map.put(REDUNDANT_CALL_OF_CONVERSION_METHOD, "Redundant call of conversion method") - map.put(ARRAY_EQUALITY_OPERATOR_CAN_BE_REPLACED_WITH_EQUALS, "Replace '==' with 'Arrays.equals'") - map.put(EMPTY_RANGE, "Range is empty") - map.put(REDUNDANT_SETTER_PARAMETER_TYPE, "Redundant setter parameter type") - map.put(UNUSED_VARIABLE, "Variable is unused") - map.put(ASSIGNED_VALUE_IS_NEVER_READ, "Assigned value is never read") - map.put(VARIABLE_INITIALIZER_IS_REDUNDANT, "Initializer is redundant") - map.put(VARIABLE_NEVER_READ, "Variable is never read") + map.put(REDUNDANT_VISIBILITY_MODIFIER, "Redundant visibility modifier.") + map.put(REDUNDANT_MODALITY_MODIFIER, "Redundant modality modifier.") + map.put(REDUNDANT_RETURN_UNIT_TYPE, "Redundant return 'Unit' type.") + map.put(REDUNDANT_EXPLICIT_TYPE, "Redundant explicit type.") + map.put(REDUNDANT_SINGLE_EXPRESSION_STRING_TEMPLATE, "Redundant string template.") + map.put(CAN_BE_VAL, "The 'var' property is never written to, so it can be declared as 'val'.") + map.put(CAN_BE_REPLACED_WITH_OPERATOR_ASSIGNMENT, "Assignment can be replaced with operator assignment.") + map.put(REDUNDANT_CALL_OF_CONVERSION_METHOD, "Redundant call of conversion method.") + map.put(ARRAY_EQUALITY_OPERATOR_CAN_BE_REPLACED_WITH_EQUALS, "'==' compares only references. Replace '==' with 'contentEquals' to compare the arrays' contents.") + map.put(EMPTY_RANGE, "Range is empty.") + map.put(REDUNDANT_SETTER_PARAMETER_TYPE, "Redundant setter parameter type.") + map.put(UNUSED_VARIABLE, "Variable is unused.") + map.put(ASSIGNED_VALUE_IS_NEVER_READ, "Assigned value is never read.") + map.put(VARIABLE_INITIALIZER_IS_REDUNDANT, "Initializer is redundant.") + map.put(VARIABLE_NEVER_READ, "Variable is never read.") } } diff --git a/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/FirSyntaxErrorsDefaultMessages.kt b/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/FirSyntaxErrorsDefaultMessages.kt index 25b8441853f..05a50e65a27 100644 --- a/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/FirSyntaxErrorsDefaultMessages.kt +++ b/compiler/fir/raw-fir/raw-fir.common/src/org/jetbrains/kotlin/fir/builder/FirSyntaxErrorsDefaultMessages.kt @@ -9,9 +9,8 @@ import org.jetbrains.kotlin.diagnostics.KtDiagnosticFactoryToRendererMap import org.jetbrains.kotlin.diagnostics.KtDiagnosticRenderers.OPTIONAL_COLON_TO_STRING import org.jetbrains.kotlin.diagnostics.rendering.BaseDiagnosticRendererFactory -@Suppress("unused") object FirSyntaxErrorsDefaultMessages : BaseDiagnosticRendererFactory() { override val MAP = KtDiagnosticFactoryToRendererMap("FIR").also { map -> - map.put(FirSyntaxErrors.SYNTAX, "Syntax error{0}", OPTIONAL_COLON_TO_STRING) + map.put(FirSyntaxErrors.SYNTAX, "Syntax error{0}.", OPTIONAL_COLON_TO_STRING) } } diff --git a/compiler/frontend.common/src/org/jetbrains/kotlin/diagnostics/KtDiagnosticFactoryToRendererMap.kt b/compiler/frontend.common/src/org/jetbrains/kotlin/diagnostics/KtDiagnosticFactoryToRendererMap.kt index 9e2bbb5e1ed..d0a1329aaab 100644 --- a/compiler/frontend.common/src/org/jetbrains/kotlin/diagnostics/KtDiagnosticFactoryToRendererMap.kt +++ b/compiler/frontend.common/src/org/jetbrains/kotlin/diagnostics/KtDiagnosticFactoryToRendererMap.kt @@ -115,7 +115,8 @@ class KtDiagnosticFactoryToRendererMap(val name: String) { private fun KtDiagnosticFactoryForDeprecation<*>.warningMessage(errorMessage: String): String { return buildString { append(errorMessage) - append(". This will become an error") + if (!errorMessage.endsWith(".")) append(".") + append(" This will become an error") val sinceVersion = deprecatingFeature.sinceVersion if (sinceVersion != null) { append(" in Kotlin ") @@ -123,6 +124,7 @@ class KtDiagnosticFactoryToRendererMap(val name: String) { } else { append(" in a future release") } + append(".") } } } diff --git a/plugins/parcelize/parcelize-compiler/parcelize.k2/src/org/jetbrains/kotlin/parcelize/fir/diagnostics/KtDefaultErrorMessagesParcelize.kt b/plugins/parcelize/parcelize-compiler/parcelize.k2/src/org/jetbrains/kotlin/parcelize/fir/diagnostics/KtDefaultErrorMessagesParcelize.kt index 4c23eaa5202..d7fe0fc6c20 100644 --- a/plugins/parcelize/parcelize-compiler/parcelize.k2/src/org/jetbrains/kotlin/parcelize/fir/diagnostics/KtDefaultErrorMessagesParcelize.kt +++ b/plugins/parcelize/parcelize-compiler/parcelize.k2/src/org/jetbrains/kotlin/parcelize/fir/diagnostics/KtDefaultErrorMessagesParcelize.kt @@ -49,126 +49,126 @@ object KtDefaultErrorMessagesParcelize : BaseDiagnosticRendererFactory() { override val MAP = KtDiagnosticFactoryToRendererMap("Parcelize").also { map -> map.put( PARCELABLE_SHOULD_BE_CLASS, - "'Parcelable' should be a class" + "'Parcelable' should be a class." ) map.put( PARCELABLE_DELEGATE_IS_NOT_ALLOWED, - "Delegating 'Parcelable' is not allowed" + "Delegating 'Parcelable' is not allowed." ) map.put( PARCELABLE_SHOULD_NOT_BE_ENUM_CLASS, - "'Parcelable' should not be a 'enum class'" + "'Parcelable' should not be a 'enum class'." ) map.put( PARCELABLE_SHOULD_BE_INSTANTIABLE, - "'Parcelable' should not be an 'abstract' class" + "'Parcelable' should not be an 'abstract' class." ) map.put( PARCELABLE_CANT_BE_INNER_CLASS, - "'Parcelable' can't be an inner class" + "'Parcelable' can't be an inner class." ) map.put( PARCELABLE_CANT_BE_LOCAL_CLASS, - "'Parcelable' can't be a local class" + "'Parcelable' can't be a local class." ) map.put( NO_PARCELABLE_SUPERTYPE, - "No 'Parcelable' supertype" + "No 'Parcelable' supertype." ) map.put( PARCELABLE_SHOULD_HAVE_PRIMARY_CONSTRUCTOR, - "'Parcelable' should have a primary constructor" + "'Parcelable' should have a primary constructor." ) map.put( PARCELABLE_PRIMARY_CONSTRUCTOR_IS_EMPTY, - "The primary constructor is empty, no data will be serialized to 'Parcel'" + "The primary constructor is empty, no data will be serialized to 'Parcel'." ) map.put( PARCELABLE_CONSTRUCTOR_PARAMETER_SHOULD_BE_VAL_OR_VAR, - "'Parcelable' constructor parameter should be 'val' or 'var'" + "'Parcelable' constructor parameter should be 'val' or 'var'." ) map.put( PROPERTY_WONT_BE_SERIALIZED, - "Property would not be serialized into a 'Parcel'. Add '@IgnoredOnParcel' annotation to remove the warning" + "Property would not be serialized into a 'Parcel'. Add '@IgnoredOnParcel' annotation to remove the warning." ) map.put( OVERRIDING_WRITE_TO_PARCEL_IS_NOT_ALLOWED, - "Overriding 'writeToParcel' is not allowed. Use 'Parceler' companion object instead" + "Overriding 'writeToParcel' is not allowed. Use 'Parceler' companion object instead." ) map.put( CREATOR_DEFINITION_IS_NOT_ALLOWED, - "'CREATOR' definition is not allowed. Use 'Parceler' companion object instead" + "'CREATOR' definition is not allowed. Use 'Parceler' companion object instead." ) map.put( PARCELABLE_TYPE_NOT_SUPPORTED, "Type is not directly supported by 'Parcelize'. " + - "Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'" + "Annotate the parameter type with '@RawValue' if you want it to be serialized using 'writeValue()'." ) map.put( PARCELER_SHOULD_BE_OBJECT, - "Parceler should be an object" + "Parceler should be an object." ) map.put( PARCELER_TYPE_INCOMPATIBLE, - "Parceler type {0} is incompatible with {1}", + "Parceler type {0} is incompatible with {1}.", RENDER_TYPE, RENDER_TYPE ) map.put( DUPLICATING_TYPE_PARCELERS, - "Duplicating ''TypeParceler'' annotations" + "Duplicating 'TypeParceler' annotations." ) map.put( REDUNDANT_TYPE_PARCELER, - "This ''TypeParceler'' is already provided for {0}", + "This ''TypeParceler'' is already provided for ''{0}''.", RENDER_CLASS_OR_OBJECT ) map.put( CLASS_SHOULD_BE_PARCELIZE, - "{0} should be annotated with ''@Parcelize''", + "{0} should be annotated with ''@Parcelize''.", RENDER_CLASS_OR_OBJECT ) map.put( INAPPLICABLE_IGNORED_ON_PARCEL, - "'@IgnoredOnParcel' is only applicable to class properties" + "'@IgnoredOnParcel' is only applicable to class properties." ) map.put( INAPPLICABLE_IGNORED_ON_PARCEL_CONSTRUCTOR_PROPERTY, - "'@IgnoredOnParcel' is inapplicable to properties without default value declared in the primary constructor" + "'@IgnoredOnParcel' is inapplicable to properties without default value declared in the primary constructor." ) map.put( FORBIDDEN_DEPRECATED_ANNOTATION, - "Parceler-related annotations from package 'kotlinx.android.parcel' are forbidden. Change package to 'kotlinx.parcelize'" + "Parceler-related annotations from package 'kotlinx.android.parcel' are forbidden. Change package to 'kotlinx.parcelize'." ) map.put( DEPRECATED_ANNOTATION, - "Parcelize annotations from package 'kotlinx.android.parcel' are deprecated. Change package to 'kotlinx.parcelize'" + "Parcelize annotations from package 'kotlinx.android.parcel' are deprecated. Change package to 'kotlinx.parcelize'." ) map.put( DEPRECATED_PARCELER, - "'kotlinx.android.parcel.Parceler' is deprecated. Use 'kotlinx.parcelize.Parceler' instead" + "'kotlinx.android.parcel.Parceler' is deprecated. Use 'kotlinx.parcelize.Parceler' instead." ) } }