FIR IDE: pass candidate super types for AMBIGUOUS_SUPER
This way the IDE quickfix do not need to do resolution again to figure out what super type to offer in the quickfix.
This commit is contained in:
committed by
Ilya Kirillov
parent
7c3706dd3f
commit
bdc71a3281
+3
@@ -569,6 +569,9 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
}
|
||||
add(FirErrors.AMBIGUOUS_SUPER) { firDiagnostic ->
|
||||
AmbiguousSuperImpl(
|
||||
firDiagnostic.a.map { coneKotlinType ->
|
||||
firSymbolBuilder.typeBuilder.buildKtType(coneKotlinType)
|
||||
},
|
||||
firDiagnostic as FirPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
|
||||
+1
@@ -425,6 +425,7 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
|
||||
abstract class AmbiguousSuper : KtFirDiagnostic<KtSuperExpression>() {
|
||||
override val diagnosticClass get() = AmbiguousSuper::class
|
||||
abstract val candidates: List<KtType>
|
||||
}
|
||||
|
||||
abstract class ConstructorInObject : KtFirDiagnostic<KtDeclaration>() {
|
||||
|
||||
+1
@@ -500,6 +500,7 @@ internal class InconsistentTypeParameterBoundsImpl(
|
||||
) : KtFirDiagnostic.InconsistentTypeParameterBounds(), KtAbstractFirDiagnostic<PsiElement>
|
||||
|
||||
internal class AmbiguousSuperImpl(
|
||||
override val candidates: List<KtType>,
|
||||
override val firDiagnostic: FirPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.AmbiguousSuper(), KtAbstractFirDiagnostic<KtSuperExpression>
|
||||
|
||||
Reference in New Issue
Block a user