diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguous.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguous.txt index b13ecae010b..6166b9339a7 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguous.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguous.txt @@ -82,4 +82,7 @@ KtErrorCallInfo: callableIdIfNonLocal = null) } ] - diagnostic = ERROR + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousImplicitInvoke.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousImplicitInvoke.txt index b64e346af04..90a92b582fe 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousImplicitInvoke.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousImplicitInvoke.txt @@ -47,4 +47,6 @@ KtErrorCallInfo: typeArgumentsMapping = {} argumentMapping = {} ] - diagnostic = ERROR + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithExplicitTypeParameters.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithExplicitTypeParameters.txt index eff3af90f04..b82da1b229f 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithExplicitTypeParameters.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithExplicitTypeParameters.txt @@ -106,4 +106,7 @@ KtErrorCallInfo: callableIdIfNonLocal = null) } ] - diagnostic = ERROR function(t: T, a: Char): Unit, fun function(u: U, b: Boolean): Unit, fun function(v: V, c: String): Unit]> + diagnostic = ERROR function(t: T, a: Char): Unit + fun function(u: U, b: Boolean): Unit + fun function(v: V, c: String): Unit> \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithInferredTypeParameters.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithInferredTypeParameters.txt index e8c9c6b5764..ff4062e7c9d 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithInferredTypeParameters.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/ambiguousWithInferredTypeParameters.txt @@ -100,4 +100,7 @@ KtErrorCallInfo: callableIdIfNonLocal = null) } ] - diagnostic = ERROR function(t: T, a: Char): Unit, fun function(u: U, b: Boolean): Unit, fun function(v: V, c: String): Unit]> + diagnostic = ERROR function(t: T, a: Char): Unit + fun function(u: U, b: Boolean): Unit + fun function(v: V, c: String): Unit> \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.txt b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.txt index 022af9439a5..71cd2106eb2 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCall/delegatedConstructorCall_this_unresolved.txt @@ -47,4 +47,6 @@ KtErrorCallInfo: typeArgumentsMapping = {} argumentMapping = {} ] - diagnostic = ERROR + diagnostic = ERROR \ No newline at end of file diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke1.txt b/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke1.txt index 9056998275b..49f89c55220 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke1.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke1.txt @@ -1,5 +1,6 @@ KtInapplicableCallCandidateInfo: - diagnostic = ERROR + diagnostic = ERROR candidate = KtSimpleFunctionCall: isImplicitInvoke = true partiallyAppliedSymbol = KtPartiallyAppliedSymbol: @@ -38,7 +39,8 @@ KtApplicableCallCandidateInfo: isInBestCandidates = true KtInapplicableCallCandidateInfo: - diagnostic = ERROR + diagnostic = ERROR candidate = KtSimpleFunctionCall: isImplicitInvoke = true partiallyAppliedSymbol = KtPartiallyAppliedSymbol: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke2.txt b/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke2.txt index ed0d1e248a6..45ae158a383 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke2.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke2.txt @@ -1,5 +1,6 @@ KtInapplicableCallCandidateInfo: - diagnostic = ERROR + diagnostic = ERROR candidate = KtSimpleFunctionCall: isImplicitInvoke = true partiallyAppliedSymbol = KtPartiallyAppliedSymbol: @@ -19,7 +20,8 @@ KtInapplicableCallCandidateInfo: isInBestCandidates = false KtInapplicableCallCandidateInfo: - diagnostic = ERROR + diagnostic = ERROR candidate = KtSimpleFunctionCall: isImplicitInvoke = true partiallyAppliedSymbol = KtPartiallyAppliedSymbol: diff --git a/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke3.txt b/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke3.txt index 75c5a2b254b..4b14ca5dd9d 100644 --- a/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke3.txt +++ b/analysis/analysis-api/testData/components/callResolver/resolveCandidates/singleCandidate/consecutiveImplicitInvoke3.txt @@ -18,7 +18,8 @@ KtApplicableCallCandidateInfo: isInBestCandidates = true KtInapplicableCallCandidateInfo: - diagnostic = ERROR + diagnostic = ERROR candidate = KtSimpleFunctionCall: isImplicitInvoke = true partiallyAppliedSymbol = KtPartiallyAppliedSymbol: @@ -38,7 +39,8 @@ KtInapplicableCallCandidateInfo: isInBestCandidates = false KtInapplicableCallCandidateInfo: - diagnostic = ERROR + diagnostic = ERROR candidate = KtSimpleFunctionCall: isImplicitInvoke = true partiallyAppliedSymbol = KtPartiallyAppliedSymbol: diff --git a/compiler/fir/analysis-tests/testData/resolve/enum.fir.diag.txt b/compiler/fir/analysis-tests/testData/resolve/enum.fir.diag.txt index b5e025bab39..41b559ccb32 100644 --- a/compiler/fir/analysis-tests/testData/resolve/enum.fir.diag.txt +++ b/compiler/fir/analysis-tests/testData/resolve/enum.fir.diag.txt @@ -1,3 +1,7 @@ -/enum.kt:(506,508): error: Enum entry 'EnumClass.E2' does not implement abstract members: [fun foo(): Int, val bar: String]. +/enum.kt:(506,508): error: Enum entry 'EnumClass.E2' does not implement abstract members: +fun foo(): Int +val bar: String -/enum.kt:(524,526): error: Enum entry 'EnumClass.E3' does not implement abstract members: [fun foo(): Int, val bar: String]. +/enum.kt:(524,526): error: Enum entry 'EnumClass.E3' does not implement abstract members: +fun foo(): Int +val bar: String 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 197a8c5da9a..a8a74a36a7b 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 @@ -160,16 +160,16 @@ object FirJsErrorsDefaultMessages : BaseDiagnosticRendererFactory() { map.put(NAME_CONTAINS_ILLEGAL_CHARS, "Name contains illegal chars that cannot appear in JavaScript identifier.") map.put( JS_NAME_CLASH, - "JavaScript name ({0}) generated for this declaration clashes with another declarations: {1}", + "JavaScript name ''{0}'' generated for this declaration clashes with other declarations:{1}", CommonRenderers.STRING, - FirDiagnosticRenderers.SYMBOLS + FirDiagnosticRenderers.SYMBOLS_ON_NEXT_LINES ) map.put( JS_FAKE_NAME_CLASH, - "JavaScript name {0} is generated for different inherited members: {1} and {2}", + "JavaScript name ''{0}'' is generated for different inherited members:\n{1}{2}", CommonRenderers.STRING, FirDiagnosticRenderers.SYMBOL, - FirDiagnosticRenderers.SYMBOLS + FirDiagnosticRenderers.SYMBOLS_ON_NEXT_LINES ) map.put(JS_NAME_IS_NOT_ON_ALL_ACCESSORS, "'@JsName' should be on all the property accessors.") 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 0a7a9b4f303..68dadcb1ac4 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 @@ -10,7 +10,7 @@ import org.jetbrains.kotlin.diagnostics.KtDiagnosticRenderers.TO_STRING import org.jetbrains.kotlin.diagnostics.rendering.BaseDiagnosticRendererFactory import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOL -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOLS +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOLS_ON_NEXT_LINES import org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors.CANNOT_CHECK_FOR_FORWARD_DECLARATION import org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors.CONFLICTING_OBJC_OVERLOADS import org.jetbrains.kotlin.fir.analysis.diagnostics.native.FirNativeErrors.CONSTRUCTOR_DOES_NOT_OVERRIDE_ANY_SUPER_CONSTRUCTOR @@ -53,7 +53,7 @@ object FirNativeErrorsDefaultMessages : BaseDiagnosticRendererFactory() { override val MAP = KtDiagnosticFactoryToRendererMap("FIR").also { map -> 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(INCOMPATIBLE_THROWS_INHERITED, "Member inherits different ''@Throws'' filters from:{0}", SYMBOLS_ON_NEXT_LINES) map.put( MISSING_EXCEPTION_IN_THROWS_ON_SUSPEND, "''@Throws'' on suspend declaration must have ''{0}'' (or any of its superclasses) listed.", TO_STRING @@ -72,9 +72,9 @@ object FirNativeErrorsDefaultMessages : BaseDiagnosticRendererFactory() { 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 + SYMBOLS_ON_NEXT_LINES ) map.put( INVALID_OBJC_HIDES_TARGETS, @@ -89,7 +89,7 @@ object FirNativeErrorsDefaultMessages : BaseDiagnosticRendererFactory() { 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(INCOMPATIBLE_OBJC_NAME_OVERRIDE, "Member ''{0}'' inherits inconsistent ''@ObjCName'' from:{1}", SYMBOL, SYMBOLS_ON_NEXT_LINES) 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.") @@ -149,8 +149,8 @@ object FirNativeErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( CONFLICTING_OBJC_OVERLOADS, - "Conflicting overloads: {0}. Add @ObjCSignatureOverride to allow collision for functions inherited from Objective-C.", - SYMBOLS + "Conflicting overloads:{0}\nAdd @ObjCSignatureOverride to allow collision for functions inherited from Objective-C.", + SYMBOLS_ON_NEXT_LINES ) map.put( INAPPLICABLE_OBJC_OVERRIDE, 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 bff4bc2427b..c39869963fb 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 @@ -53,7 +53,12 @@ object FirDiagnosticRenderers { } } - val SYMBOLS = KtDiagnosticRenderers.COLLECTION(SYMBOL) + /** + * Adds a line break before the list, then prints one symbol per line. + */ + val SYMBOLS_ON_NEXT_LINES = Renderer { symbols: Collection> -> + symbols.joinToString(separator = "\n", prefix = "\n", transform = SYMBOL::render) + } val SYMBOLS_ON_NEWLINE_WITH_INDENT = object : ContextIndependentParameterRenderer>> { private val mode = MultiplatformDiagnosticRenderingMode() 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 48b800d2478..b600f8ef77d 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 @@ -42,7 +42,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.REND import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.RENDER_TYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.REQUIRE_KOTLIN_VERSION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOL -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOLS +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOLS_ON_NEXT_LINES import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOLS_ON_NEWLINE_WITH_INDENT import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOL_WITH_CONTAINING_DECLARATION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.VARIABLE_NAME @@ -1126,8 +1126,8 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( AMBIGUOUS_ANNOTATION_ARGUMENT, - "Resolution of the annotation argument is ambiguous between {0}. Please use a fully qualified name as argument.", - SYMBOLS, + "Resolution of the annotation argument is ambiguous between the following candidates:{0}\nPlease use a fully qualified name as argument.", + SYMBOLS_ON_NEXT_LINES, ) // Exposed visibility group // # @@ -1187,7 +1187,7 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { 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 is applicable: {0}", SYMBOLS) + map.put(NONE_APPLICABLE, "None of the following candidates is applicable:{0}", SYMBOLS_ON_NEXT_LINES) 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 allowed only inside a parenthesized argument list.") @@ -1275,12 +1275,12 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { 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(ITERATOR_AMBIGUITY, "Method ''iterator()'' is ambiguous for this expression. Applicable candidates:{0}", SYMBOLS_ON_NEXT_LINES) 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(NEXT_AMBIGUITY, "Method ''next()'' is ambiguous for this expression. Applicable candidates:{0}", SYMBOLS_ON_NEXT_LINES) 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(NEXT_NONE_APPLICABLE, "None of the ''next()'' functions is applicable for this expression. Candidates are:{0}", SYMBOLS_ON_NEXT_LINES) map.put(NO_CONTEXT_RECEIVER, "No context receiver for ''{0}'' found.", RENDER_TYPE) map.put( @@ -1306,15 +1306,15 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) // 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(OVERLOAD_RESOLUTION_AMBIGUITY, "Overload resolution ambiguity between candidates:{0}", SYMBOLS_ON_NEXT_LINES) + map.put(ASSIGN_OPERATOR_AMBIGUITY, "Ambiguity between assign operator candidates:{0}", SYMBOLS_ON_NEXT_LINES) 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_AMBIGUITY, "Method ''hasNext()'' is ambiguous for this expression. Applicable candidates:{0}", SYMBOLS_ON_NEXT_LINES) + map.put(HAS_NEXT_FUNCTION_NONE_APPLICABLE, "None of the ''hasNext()'' functions is applicable for this expression. Candidates are:{0}", SYMBOLS_ON_NEXT_LINES) map.put( UNRESOLVED_REFERENCE_WRONG_RECEIVER, - "Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: {0}", - SYMBOLS + "Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch:{0}", + SYMBOLS_ON_NEXT_LINES ) // Types & type parameters @@ -1668,9 +1668,9 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( ABSTRACT_MEMBER_NOT_IMPLEMENTED_BY_ENUM_ENTRY, - "{0} does not implement abstract members: {1}.", + "{0} does not implement abstract members:{1}", RENDER_ENUM_ENTRY_QUOTED, - SYMBOLS, + SYMBOLS_ON_NEXT_LINES, ) map.put( ABSTRACT_CLASS_MEMBER_NOT_IMPLEMENTED, @@ -1816,9 +1816,9 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { // Redeclarations 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(CONFLICTING_OVERLOADS, "Conflicting overloads:{0}", SYMBOLS_ON_NEXT_LINES) + map.put(REDECLARATION, "Conflicting declarations:{0}", SYMBOLS_ON_NEXT_LINES) + map.put(PACKAGE_OR_CLASSIFIER_REDECLARATION, "Redeclaration:{0}", SYMBOLS_ON_NEXT_LINES) map.put(EXPECT_AND_ACTUAL_IN_THE_SAME_MODULE, "{0}: expect and corresponding actual are declared in the same module", DECLARATION_NAME) map.put(METHOD_OF_ANY_IMPLEMENTED_IN_INTERFACE, "Interfaces cannot implement a method of 'Any'.") @@ -2305,15 +2305,15 @@ object FirErrorsDefaultMessages : BaseDiagnosticRendererFactory() { ) map.put( DELEGATE_SPECIAL_FUNCTION_AMBIGUITY, - "Overload resolution ambiguity on method ''{0}'': {1}", + "Overload resolution ambiguity on method ''{0}'':{1}", TO_STRING, - SYMBOLS + SYMBOLS_ON_NEXT_LINES ) map.put( DELEGATE_SPECIAL_FUNCTION_NONE_APPLICABLE, - "Property delegate must have a ''{0}'' method. None of the following functions is suitable: {1}", + "Property delegate must have a ''{0}'' method. None of the following functions is applicable:{1}", TO_STRING, - SYMBOLS + SYMBOLS_ON_NEXT_LINES ) map.put( DELEGATE_SPECIAL_FUNCTION_RETURN_TYPE_MISMATCH, diff --git a/compiler/testData/cli/jvm/conflictingOverloads.out b/compiler/testData/cli/jvm/conflictingOverloads.out index 9d7235a1fc0..e9f10fea5df 100644 --- a/compiler/testData/cli/jvm/conflictingOverloads.out +++ b/compiler/testData/cli/jvm/conflictingOverloads.out @@ -1,7 +1,9 @@ -compiler/testData/cli/jvm/conflictingOverloads.kt:1:1: error: conflicting overloads: [fun a(): List] +compiler/testData/cli/jvm/conflictingOverloads.kt:1:1: error: conflicting overloads: +fun a(): List fun a(): List = null!! ^^^^^^^^^^^^^^^^^^ -compiler/testData/cli/jvm/conflictingOverloads.kt:2:1: error: conflicting overloads: [fun a(): List] +compiler/testData/cli/jvm/conflictingOverloads.kt:2:1: error: conflicting overloads: +fun a(): List fun a(): List = null!! ^^^^^^^^^^^^^^^^^^^^^ COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/diagnosticsOrder.out b/compiler/testData/cli/jvm/diagnosticsOrder.out index 9c3beee652d..7a3b4b87dd1 100644 --- a/compiler/testData/cli/jvm/diagnosticsOrder.out +++ b/compiler/testData/cli/jvm/diagnosticsOrder.out @@ -1,28 +1,72 @@ -compiler/testData/cli/jvm/diagnosticsOrder1.kt:1:5: error: conflicting declarations: [val x: Int, val x: Int, val x: Int, ...] +compiler/testData/cli/jvm/diagnosticsOrder1.kt:1:5: error: conflicting declarations: +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int val x = 5 ^ -compiler/testData/cli/jvm/diagnosticsOrder1.kt:2:5: error: conflicting declarations: [val x: Int, val x: Int, val x: Int, ...] +compiler/testData/cli/jvm/diagnosticsOrder1.kt:2:5: error: conflicting declarations: +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int val x = 5 ^ -compiler/testData/cli/jvm/diagnosticsOrder1.kt:3:5: error: conflicting declarations: [val x: Int, val x: Int, val x: Int, ...] +compiler/testData/cli/jvm/diagnosticsOrder1.kt:3:5: error: conflicting declarations: +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int val x = 5 ^ -compiler/testData/cli/jvm/diagnosticsOrder1.kt:4:5: error: conflicting declarations: [val x: Int, val x: Int, val x: Int, ...] +compiler/testData/cli/jvm/diagnosticsOrder1.kt:4:5: error: conflicting declarations: +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int val x = 5 ^ -compiler/testData/cli/jvm/diagnosticsOrder1.kt:5:5: error: conflicting declarations: [val x: Int, val x: Int, val x: Int, ...] +compiler/testData/cli/jvm/diagnosticsOrder1.kt:5:5: error: conflicting declarations: +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int val x = 5 ^ -compiler/testData/cli/jvm/diagnosticsOrder1.kt:6:5: error: conflicting declarations: [val x: Int, val x: Int, val x: Int, ...] +compiler/testData/cli/jvm/diagnosticsOrder1.kt:6:5: error: conflicting declarations: +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int val x = 5 ^ -compiler/testData/cli/jvm/diagnosticsOrder1.kt:7:5: error: conflicting declarations: [val x: Int, val x: Int, val x: Int, ...] +compiler/testData/cli/jvm/diagnosticsOrder1.kt:7:5: error: conflicting declarations: +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int +val x: Int val x = 5 ^ -compiler/testData/cli/jvm/diagnosticsOrder2.kt:1:5: error: conflicting declarations: [val y: Int] +compiler/testData/cli/jvm/diagnosticsOrder2.kt:1:5: error: conflicting declarations: +val y: Int val y = 5 ^ -compiler/testData/cli/jvm/diagnosticsOrder2.kt:2:5: error: conflicting declarations: [val y: Int] +compiler/testData/cli/jvm/diagnosticsOrder2.kt:2:5: error: conflicting declarations: +val y: Int val y = 5 ^ -COMPILATION_ERROR \ No newline at end of file +COMPILATION_ERROR diff --git a/compiler/testData/cli/jvm/readingConfigFromEnvironment/simple.out b/compiler/testData/cli/jvm/readingConfigFromEnvironment/simple.out index 57015852ee6..079f2d79ac5 100644 --- a/compiler/testData/cli/jvm/readingConfigFromEnvironment/simple.out +++ b/compiler/testData/cli/jvm/readingConfigFromEnvironment/simple.out @@ -1,4 +1,10 @@ -compiler/testData/cli/jvm/readingConfigFromEnvironment/simple.kt:2:15: error: [NONE_APPLICABLE] None of the following functions is applicable: [@IntrinsicConstEvaluation() fun plus(other: Int): Int, @IntrinsicConstEvaluation() fun plus(other: Byte): Int, @IntrinsicConstEvaluation() fun plus(other: Double): Double, ...] +compiler/testData/cli/jvm/readingConfigFromEnvironment/simple.kt:2:15: error: [NONE_APPLICABLE] None of the following candidates is applicable: +@IntrinsicConstEvaluation() fun plus(other: Int): Int +@IntrinsicConstEvaluation() fun plus(other: Byte): Int +@IntrinsicConstEvaluation() fun plus(other: Double): Double +@IntrinsicConstEvaluation() fun plus(other: Float): Float +@IntrinsicConstEvaluation() fun plus(other: Long): Long +@IntrinsicConstEvaluation() fun plus(other: Short): Int val x = 1 + "" ^ COMPILATION_ERROR diff --git a/compiler/testData/diagnostics/tests/annotations/rendering/conflictingOverloads.fir.kt b/compiler/testData/diagnostics/tests/annotations/rendering/conflictingOverloads.fir.kt index d808cdf5cd4..0e03a41ae63 100644 --- a/compiler/testData/diagnostics/tests/annotations/rendering/conflictingOverloads.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/rendering/conflictingOverloads.fir.kt @@ -4,7 +4,7 @@ annotation class An @An -data class A(@An val x: @An Int) { - @An +data class A(@An val x: @An Int) { + @An fun copy(@An x: @An Int) = x } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/extensions/contextReceivers/contextReceiverAmbiguity.fir.diag.txt b/compiler/testData/diagnostics/tests/extensions/contextReceivers/contextReceiverAmbiguity.fir.diag.txt index 93f781a214d..6068aa771fe 100644 --- a/compiler/testData/diagnostics/tests/extensions/contextReceivers/contextReceiverAmbiguity.fir.diag.txt +++ b/compiler/testData/diagnostics/tests/extensions/contextReceivers/contextReceiverAmbiguity.fir.diag.txt @@ -1 +1,3 @@ -/contextReceiverAmbiguity.kt:(203,206): error: Overload resolution ambiguity between candidates: [context(String) fun foo(x: Comparable<*>): Unit, context(String) fun foo(x: Number): Unit] +/contextReceiverAmbiguity.kt:(203,206): error: Overload resolution ambiguity between candidates: +context(String) fun foo(x: Comparable<*>): Unit +context(String) fun foo(x: Number): Unit diff --git a/compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity.fir.diag.txt b/compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity.fir.diag.txt index 4c7707671f7..671cd3e90ff 100644 --- a/compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity.fir.diag.txt +++ b/compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity.fir.diag.txt @@ -1 +1,3 @@ -/test.kt:(154,158): error: Overload resolution ambiguity between candidates: [static field SOME: String, static enum entry SOME: SomeEnum] +/test.kt:(154,158): error: Overload resolution ambiguity between candidates: +static field SOME: String +static enum entry SOME: SomeEnum diff --git a/compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity3.fir.diag.txt b/compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity3.fir.diag.txt index eaf3c3708a1..32868a5412c 100644 --- a/compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity3.fir.diag.txt +++ b/compiler/testData/diagnostics/tests/imports/EnumEntryVsStaticAmbiguity3.fir.diag.txt @@ -1 +1,3 @@ -/test.kt:(160,164): error: Overload resolution ambiguity between candidates: [static field SOME: String, static enum entry SOME: SomeEnum] +/test.kt:(160,164): error: Overload resolution ambiguity between candidates: +static field SOME: String +static enum entry SOME: SomeEnum diff --git a/compiler/testData/diagnostics/tests/overload/RedeclarationThroughDestructuring.fir.diag.txt b/compiler/testData/diagnostics/tests/overload/RedeclarationThroughDestructuring.fir.diag.txt index ed23de45813..e56516b5e8f 100644 --- a/compiler/testData/diagnostics/tests/overload/RedeclarationThroughDestructuring.fir.diag.txt +++ b/compiler/testData/diagnostics/tests/overload/RedeclarationThroughDestructuring.fir.diag.txt @@ -1,3 +1,7 @@ -/RedeclarationThroughDestructuring.fir.kt:(133,134): error: Conflicting declarations: [local val b: String, local val b: Int] +/RedeclarationThroughDestructuring.fir.kt:(133,134): error: Conflicting declarations: +local val b: String +local val b: Int -/RedeclarationThroughDestructuring.fir.kt:(136,137): error: Conflicting declarations: [local val b: String, local val b: Int] +/RedeclarationThroughDestructuring.fir.kt:(136,137): error: Conflicting declarations: +local val b: String +local val b: Int diff --git a/compiler/testData/diagnostics/tests/varargs/AmbiguousVararg.fir.diag.txt b/compiler/testData/diagnostics/tests/varargs/AmbiguousVararg.fir.diag.txt index 13d55742f7c..de60567ce37 100644 --- a/compiler/testData/diagnostics/tests/varargs/AmbiguousVararg.fir.diag.txt +++ b/compiler/testData/diagnostics/tests/varargs/AmbiguousVararg.fir.diag.txt @@ -1 +1,3 @@ -/AmbiguousVararg.kt:(128,131): error: Overload resolution ambiguity between candidates: [fun foo(vararg t: String): String, fun foo(vararg t: Int): String] +/AmbiguousVararg.kt:(128,131): error: Overload resolution ambiguity between candidates: +fun foo(vararg t: String): String +fun foo(vararg t: Int): String diff --git a/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.log.expected b/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.log.expected index 1e1396e9ab5..4b47b083378 100644 --- a/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.log.expected +++ b/compiler/testData/integration/ant/jvm/overloadResolutionOnCollectionLiteral/build.log.expected @@ -5,13 +5,17 @@ build: [mkdir] Created dir: [Temp]/classes [javac] Compiling 2 source files to [Temp]/classes [javac] Compiling [[TestData]] => [[Temp]/classes] - [javac] [TestData]/literals.kt:9:9: error: overload resolution ambiguity between candidates: [fun intArrayOf(vararg elements: Int): IntArray, fun intArrayOf(vararg elements: Int): IntArray] + [javac] [TestData]/literals.kt:9:9: error: overload resolution ambiguity between candidates: + [javac] fun intArrayOf(vararg elements: Int): IntArray + [javac] fun intArrayOf(vararg elements: Int): IntArray [javac] @AnnInt(intArrayOf(1, 2)) [javac] ^^^^^^^^^^ - [javac] [TestData]/myArrayOf.kt:3:1: error: conflicting overloads: [fun intArrayOf(vararg elements: Int): IntArray] + [javac] [TestData]/myArrayOf.kt:3:1: error: conflicting overloads: + [javac] fun intArrayOf(vararg elements: Int): IntArray [javac] public fun intArrayOf(vararg elements: Int): IntArray = TODO() [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - [javac] [TestData]/myArrayOf.kt:4:1: error: conflicting overloads: [fun intArrayOf(vararg elements: Int): IntArray] + [javac] [TestData]/myArrayOf.kt:4:1: error: conflicting overloads: + [javac] fun intArrayOf(vararg elements: Int): IntArray [javac] public fun intArrayOf(vararg elements: Int): IntArray = TODO() [javac] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/compiler/testData/javaModules/jdkModulesFromNamed/main.fir.txt b/compiler/testData/javaModules/jdkModulesFromNamed/main.fir.txt index ae15b65e571..fde55d756fe 100644 --- a/compiler/testData/javaModules/jdkModulesFromNamed/main.fir.txt +++ b/compiler/testData/javaModules/jdkModulesFromNamed/main.fir.txt @@ -1,7 +1,17 @@ compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:11:18: error: unresolved reference 'swing'. val s: javax.swing.JFrame? = null ^^^^^ -compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:12:5: error: overload resolution ambiguity between candidates: [@InlineOnly() fun println(message: Any?): Unit, @InlineOnly() fun println(message: Boolean): Unit, @InlineOnly() fun println(message: Byte): Unit, ...] +compiler/testData/javaModules/jdkModulesFromNamed/main/test.kt:12:5: error: overload resolution ambiguity between candidates: +@InlineOnly() fun println(message: Any?): Unit +@InlineOnly() fun println(message: Boolean): Unit +@InlineOnly() fun println(message: Byte): Unit +@InlineOnly() fun println(message: Char): Unit +@InlineOnly() fun println(message: CharArray): Unit +@InlineOnly() fun println(message: Double): Unit +@InlineOnly() fun println(message: Float): Unit +@InlineOnly() fun println(message: Int): Unit +@InlineOnly() fun println(message: Long): Unit +@InlineOnly() fun println(message: Short): Unit println(s) ^^^^^^^ COMPILATION_ERROR diff --git a/jps/jps-plugin/testData/incremental/lookupTracker/jvm/syntheticProperties/build.log b/jps/jps-plugin/testData/incremental/lookupTracker/jvm/syntheticProperties/build.log index ebb2fd11200..4ace544b6cd 100644 --- a/jps/jps-plugin/testData/incremental/lookupTracker/jvm/syntheticProperties/build.log +++ b/jps/jps-plugin/testData/incremental/lookupTracker/jvm/syntheticProperties/build.log @@ -5,9 +5,17 @@ Compiling files: Exit code: COMPILATION_ERROR Unresolved reference 'setFoo'. 'val' cannot be reassigned. - Overload resolution ambiguity between candidates: [var bazBaz: Int, val bazBaz: Int] - Overload resolution ambiguity between candidates: [var bazBaz: Int, val bazBaz: Int] + Overload resolution ambiguity between candidates: +var bazBaz: Int +val bazBaz: Int + Overload resolution ambiguity between candidates: +var bazBaz: Int +val bazBaz: Int Unresolved reference 'boo'. - Overload resolution ambiguity between candidates: [var bazBaz: Int, val bazBaz: Int] - Overload resolution ambiguity between candidates: [var bazBaz: Int, val bazBaz: Int] + Overload resolution ambiguity between candidates: +var bazBaz: Int +val bazBaz: Int + Overload resolution ambiguity between candidates: +var bazBaz: Int +val bazBaz: Int Unresolved reference 'boo'. \ No newline at end of file diff --git a/plugins/assign-plugin/testData/diagnostics/incorrectUsage.fir.diag.txt b/plugins/assign-plugin/testData/diagnostics/incorrectUsage.fir.diag.txt index f12057bd9cc..78e990495d6 100644 --- a/plugins/assign-plugin/testData/diagnostics/incorrectUsage.fir.diag.txt +++ b/plugins/assign-plugin/testData/diagnostics/incorrectUsage.fir.diag.txt @@ -1,7 +1,11 @@ -/incorrectUsage.fir.kt:(390,395): error: None of the following functions is applicable: [fun assign(v: String): Unit, fun assign(v: StringProperty): Unit] +/incorrectUsage.fir.kt:(390,395): error: None of the following candidates is applicable: +fun assign(v: String): Unit +fun assign(v: StringProperty): Unit /incorrectUsage.fir.kt:(396,397): error: -/incorrectUsage.fir.kt:(536,541): error: None of the following functions is applicable: [fun assign(v: String): Unit, fun assign(v: StringProperty): Unit] +/incorrectUsage.fir.kt:(536,541): error: None of the following candidates is applicable: +fun assign(v: String): Unit +fun assign(v: StringProperty): Unit /incorrectUsage.fir.kt:(542,543): error: diff --git a/plugins/assign-plugin/testData/diagnostics/plusAssignPrecedence.fir.diag.txt b/plugins/assign-plugin/testData/diagnostics/plusAssignPrecedence.fir.diag.txt index 1681f13679a..2cc065acfeb 100644 --- a/plugins/assign-plugin/testData/diagnostics/plusAssignPrecedence.fir.diag.txt +++ b/plugins/assign-plugin/testData/diagnostics/plusAssignPrecedence.fir.diag.txt @@ -2,4 +2,6 @@ /plusAssignPrecedence.fir.kt:(2227,2229): error: Unresolved reference 'plusAssign'. -/plusAssignPrecedence.fir.kt:(2308,2310): error: Ambiguity between assign operator candidates: [fun plus(v: String): StringPropertyWithPlusAndPlusAssign, fun plusAssign(v: String): Unit] +/plusAssignPrecedence.fir.kt:(2308,2310): error: Ambiguity between assign operator candidates: +fun plus(v: String): StringPropertyWithPlusAndPlusAssign +fun plusAssign(v: String): Unit