FIR: Add candidates to ConeFunctionCallExpectedError.
This commit is contained in:
committed by
Ilya Kirillov
parent
16eabf0ff1
commit
cba77452f3
@@ -642,9 +642,7 @@ class FirCallResolver(
|
||||
val candidate = candidates.singleOrNull()
|
||||
|
||||
val diagnostic = if (expectedCallKind == CallKind.Function) {
|
||||
ConeFunctionCallExpectedError(
|
||||
name,
|
||||
candidate?.let { isValueParametersNotEmpty(it) } ?: candidates.any { isValueParametersNotEmpty(it) })
|
||||
ConeFunctionCallExpectedError(name, candidates.any { isValueParametersNotEmpty(it) }, candidates.map { it.symbol })
|
||||
} else {
|
||||
val singleExpectedCandidate = expectedCandidates?.singleOrNull()
|
||||
|
||||
|
||||
+5
-1
@@ -54,7 +54,11 @@ class ConeUnresolvedNameError(val name: Name) : ConeUnresolvedError {
|
||||
override val reason: String get() = "Unresolved name: $name"
|
||||
}
|
||||
|
||||
class ConeFunctionCallExpectedError(val name: Name, val hasValueParameters: Boolean) : ConeDiagnostic {
|
||||
class ConeFunctionCallExpectedError(
|
||||
val name: Name,
|
||||
val hasValueParameters: Boolean,
|
||||
override val candidateSymbols: Collection<FirBasedSymbol<*>>
|
||||
) : ConeDiagnosticWithCandidates {
|
||||
override val reason: String get() = "Function call expected: $name(${if (hasValueParameters) "..." else ""})"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user