[FIR] Report separate error for delegated constructor call to interface
#KT-59216 Fixed
This commit is contained in:
committed by
Space Team
parent
5abab2197b
commit
e7c213e06e
+6
@@ -363,6 +363,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.NO_CONSTRUCTOR) { firDiagnostic ->
|
||||
NoConstructorImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.FUNCTION_CALL_EXPECTED) { firDiagnostic ->
|
||||
FunctionCallExpectedImpl(
|
||||
firDiagnostic.a,
|
||||
|
||||
+4
@@ -295,6 +295,10 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = CreatingAnInstanceOfAbstractClass::class
|
||||
}
|
||||
|
||||
interface NoConstructor : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = NoConstructor::class
|
||||
}
|
||||
|
||||
interface FunctionCallExpected : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = FunctionCallExpected::class
|
||||
val functionName: String
|
||||
|
||||
+5
@@ -339,6 +339,11 @@ internal class CreatingAnInstanceOfAbstractClassImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<KtExpression>(firDiagnostic, token), KtFirDiagnostic.CreatingAnInstanceOfAbstractClass
|
||||
|
||||
internal class NoConstructorImpl(
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.NoConstructor
|
||||
|
||||
internal class FunctionCallExpectedImpl(
|
||||
override val functionName: String,
|
||||
override val hasValueParameters: Boolean,
|
||||
|
||||
Vendored
+1
-1
@@ -1,3 +1,3 @@
|
||||
KtErrorCallInfo:
|
||||
candidateCalls = []
|
||||
diagnostic = ERROR<UNRESOLVED_REFERENCE: Unresolved reference: <init>>
|
||||
diagnostic = ERROR<NO_CONSTRUCTOR: This type does not have a constructor.>
|
||||
Reference in New Issue
Block a user