FIR: Add ConeDiagnosticWithCandidates and
ConeDiagnosticWithSingleCandidate to ConeDiagnostic type hierarchy.
This commit is contained in:
committed by
Ilya Kirillov
parent
db38cd95da
commit
16eabf0ff1
@@ -47,16 +47,6 @@ internal fun FirNamedReference.getCandidateSymbols(): Collection<FirBasedSymbol<
|
||||
|
||||
internal fun ConeDiagnostic.getCandidateSymbols(): Collection<FirBasedSymbol<*>> =
|
||||
when (this) {
|
||||
is ConeInapplicableCandidateError -> listOf(candidate.symbol)
|
||||
is ConeHiddenCandidateError -> listOf(candidateSymbol)
|
||||
is ConeAmbiguityError -> candidates.map { it.symbol }
|
||||
is ConeOperatorAmbiguityError -> candidates
|
||||
is ConeUnsupportedCallableReferenceTarget -> listOf(fir.symbol)
|
||||
is ConeUnmatchedTypeArgumentsError -> listOf(symbol)
|
||||
is ConeConstraintSystemHasContradiction -> listOf(candidate.symbol)
|
||||
is ConeDeprecated -> listOf(symbol)
|
||||
is ConeNoTypeArgumentsOnRhsError -> listOf(symbol)
|
||||
is ConeResolutionToClassifierError -> listOf(classSymbol)
|
||||
is ConeWrongNumberOfTypeArgumentsError -> listOf(symbol)
|
||||
is ConeDiagnosticWithCandidates -> candidateSymbols
|
||||
else -> emptyList()
|
||||
}
|
||||
+1
-1
@@ -56,7 +56,7 @@ internal object FirReferenceResolveHelper {
|
||||
|
||||
val symbol = resolvedSymbol ?: run {
|
||||
val diagnostic = (this as? FirErrorTypeRef)?.diagnostic
|
||||
(diagnostic as? ConeUnmatchedTypeArgumentsError)?.symbol
|
||||
(diagnostic as? ConeUnmatchedTypeArgumentsError)?.candidateSymbol
|
||||
}
|
||||
|
||||
return symbol?.fir?.buildSymbol(symbolBuilder)
|
||||
|
||||
Reference in New Issue
Block a user