[FIR] Render list of symbols with linebreaks as separators

#KT-61823 Fixed
This commit is contained in:
Kirill Rakhman
2024-02-15 12:32:59 +01:00
committed by Space Team
parent 4c9fc8f214
commit f231338cd6
27 changed files with 199 additions and 79 deletions
@@ -82,4 +82,7 @@ KtErrorCallInfo:
callableIdIfNonLocal = null)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions is applicable: [fun function(a: Char): Unit, fun function(b: Boolean): Unit, fun function(c: String): Unit]>
diagnostic = ERROR<NONE_APPLICABLE: None of the following candidates is applicable:
fun function(a: Char): Unit
fun function(b: Boolean): Unit
fun function(c: String): Unit>
@@ -47,4 +47,6 @@ KtErrorCallInfo:
typeArgumentsMapping = {}
argumentMapping = {}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions is applicable: [fun Int.invoke(a: String): Unit, fun Int.invoke(b: Boolean): Unit]>
diagnostic = ERROR<NONE_APPLICABLE: None of the following candidates is applicable:
fun Int.invoke(a: String): Unit
fun Int.invoke(b: Boolean): Unit>
@@ -106,4 +106,7 @@ KtErrorCallInfo:
callableIdIfNonLocal = null)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions is applicable: [fun <T> function(t: T, a: Char): Unit, fun <U> function(u: U, b: Boolean): Unit, fun <V> function(v: V, c: String): Unit]>
diagnostic = ERROR<NONE_APPLICABLE: None of the following candidates is applicable:
fun <T> function(t: T, a: Char): Unit
fun <U> function(u: U, b: Boolean): Unit
fun <V> function(v: V, c: String): Unit>
@@ -100,4 +100,7 @@ KtErrorCallInfo:
callableIdIfNonLocal = null)
}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions is applicable: [fun <T> function(t: T, a: Char): Unit, fun <U> function(u: U, b: Boolean): Unit, fun <V> function(v: V, c: String): Unit]>
diagnostic = ERROR<NONE_APPLICABLE: None of the following candidates is applicable:
fun <T> function(t: T, a: Char): Unit
fun <U> function(u: U, b: Boolean): Unit
fun <V> function(v: V, c: String): Unit>
@@ -47,4 +47,6 @@ KtErrorCallInfo:
typeArgumentsMapping = {}
argumentMapping = {}
]
diagnostic = ERROR<NONE_APPLICABLE: None of the following functions is applicable: [constructor(p: Int): Sub, constructor(i: Int, j: Int): Sub]>
diagnostic = ERROR<NONE_APPLICABLE: None of the following candidates is applicable:
constructor(p: Int): Sub
constructor(i: Int, j: Int): Sub>
@@ -1,5 +1,6 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: [fun Double.invoke(): Unit]>
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch:
fun Double.invoke(): Unit>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
@@ -38,7 +39,8 @@ KtApplicableCallCandidateInfo:
isInBestCandidates = true
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: [fun Long.invoke(): Double]>
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch:
fun Long.invoke(): Double>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
@@ -1,5 +1,6 @@
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: [fun Double.invoke(): Unit]>
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch:
fun Double.invoke(): Unit>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
@@ -19,7 +20,8 @@ KtInapplicableCallCandidateInfo:
isInBestCandidates = false
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: [fun Int.invoke(): Long]>
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch:
fun Int.invoke(): Long>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
@@ -18,7 +18,8 @@ KtApplicableCallCandidateInfo:
isInBestCandidates = true
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: [fun Int.invoke(): Long]>
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch:
fun Int.invoke(): Long>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
@@ -38,7 +39,8 @@ KtInapplicableCallCandidateInfo:
isInBestCandidates = false
KtInapplicableCallCandidateInfo:
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of receiver type mismatch: [fun Long.invoke(): Double]>
diagnostic = ERROR<UNRESOLVED_REFERENCE_WRONG_RECEIVER: Unresolved reference. None of the following candidates is applicable because of a receiver type mismatch:
fun Long.invoke(): Double>
candidate = KtSimpleFunctionCall:
isImplicitInvoke = true
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
@@ -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
@@ -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.")
@@ -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,
@@ -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<FirBasedSymbol<*>> ->
symbols.joinToString(separator = "\n", prefix = "\n", transform = SYMBOL::render)
}
val SYMBOLS_ON_NEWLINE_WITH_INDENT = object : ContextIndependentParameterRenderer<Collection<FirCallableSymbol<*>>> {
private val mode = MultiplatformDiagnosticRenderingMode()
@@ -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,
+4 -2
View File
@@ -1,7 +1,9 @@
compiler/testData/cli/jvm/conflictingOverloads.kt:1:1: error: conflicting overloads: [fun a(): List<String>]
compiler/testData/cli/jvm/conflictingOverloads.kt:1:1: error: conflicting overloads:
fun a(): List<String>
fun a(): List<Int> = null!!
^^^^^^^^^^^^^^^^^^
compiler/testData/cli/jvm/conflictingOverloads.kt:2:1: error: conflicting overloads: [fun a(): List<Int>]
compiler/testData/cli/jvm/conflictingOverloads.kt:2:1: error: conflicting overloads:
fun a(): List<Int>
fun a(): List<String> = null!!
^^^^^^^^^^^^^^^^^^^^^
COMPILATION_ERROR
+54 -10
View File
@@ -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
COMPILATION_ERROR
@@ -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
@@ -4,7 +4,7 @@
annotation class An
@An
data class <!CONFLICTING_OVERLOADS("[@An() fun copy(@An() x: @An() Int): @An() Int]")!>A(@An val x: @An Int)<!> {
<!CONFLICTING_OVERLOADS("[fun copy(@An() x: @An() Int = ...): A]")!>@An
data class <!CONFLICTING_OVERLOADS("@An() fun copy(@An() x: @An() Int): @An() Int")!>A(@An val x: @An Int)<!> {
<!CONFLICTING_OVERLOADS("fun copy(@An() x: @An() Int = ...): A")!>@An
fun copy(@An x: @An Int)<!> = x
}
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -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
@@ -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'.
@@ -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:
@@ -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