[FIR] Improve UPPER_BOUND_VIOLATED message
Suggest removing explicit type arguments when the upper bound is a captured type since the only way to satisfy the upper bounds is by letting the type variable be inferred to its bound. #KT-65681 Fixed
This commit is contained in:
committed by
Space Team
parent
91e4837c95
commit
58264e177f
+1
@@ -2152,6 +2152,7 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
UpperBoundViolatedImpl(
|
||||
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a),
|
||||
firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.b),
|
||||
firDiagnostic.c,
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
|
||||
+1
@@ -1533,6 +1533,7 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = UpperBoundViolated::class
|
||||
val expectedUpperBound: KtType
|
||||
val actualUpperBound: KtType
|
||||
val extraMessage: String
|
||||
}
|
||||
|
||||
interface UpperBoundViolatedInTypealiasExpansion : KtFirDiagnostic<PsiElement> {
|
||||
|
||||
+1
@@ -1839,6 +1839,7 @@ internal class ProjectionOnNonClassTypeArgumentImpl(
|
||||
internal class UpperBoundViolatedImpl(
|
||||
override val expectedUpperBound: KtType,
|
||||
override val actualUpperBound: KtType,
|
||||
override val extraMessage: String,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.UpperBoundViolated
|
||||
|
||||
Reference in New Issue
Block a user