Forbid ExtensionFunctionType on functional types without parameters
#KT-43527 Fixed
This commit is contained in:
+6
@@ -945,6 +945,12 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.WRONG_EXTENSION_FUNCTION_TYPE) { firDiagnostic ->
|
||||
WrongExtensionFunctionTypeImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirErrors.OPT_IN_USAGE) { firDiagnostic ->
|
||||
OptInUsageImpl(
|
||||
firDiagnostic.a,
|
||||
|
||||
+4
@@ -680,6 +680,10 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
override val diagnosticClass get() = NotAClass::class
|
||||
}
|
||||
|
||||
abstract class WrongExtensionFunctionType : KtFirDiagnostic<KtAnnotationEntry>() {
|
||||
override val diagnosticClass get() = WrongExtensionFunctionType::class
|
||||
}
|
||||
|
||||
abstract class OptInUsage : KtFirDiagnostic<PsiElement>() {
|
||||
override val diagnosticClass get() = OptInUsage::class
|
||||
abstract val optInMarkerFqName: FqName
|
||||
|
||||
+5
@@ -816,6 +816,11 @@ internal class NotAClassImpl(
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.NotAClass(), KtAbstractFirDiagnostic<PsiElement>
|
||||
|
||||
internal class WrongExtensionFunctionTypeImpl(
|
||||
override val firDiagnostic: KtPsiDiagnostic,
|
||||
override val token: ValidityToken,
|
||||
) : KtFirDiagnostic.WrongExtensionFunctionType(), KtAbstractFirDiagnostic<KtAnnotationEntry>
|
||||
|
||||
internal class OptInUsageImpl(
|
||||
override val optInMarkerFqName: FqName,
|
||||
override val message: String,
|
||||
|
||||
Reference in New Issue
Block a user