[FIR] Add SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC

This commit is contained in:
Ivan Kochurkin
2021-09-06 21:39:11 +03:00
committed by teamcityserver
parent 55990f65cb
commit dd46c36b24
13 changed files with 115 additions and 22 deletions
@@ -4028,4 +4028,10 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirJvmErrors.SUBCLASS_CANT_CALL_COMPANION_PROTECTED_NON_STATIC) { firDiagnostic ->
SubclassCantCallCompanionProtectedNonStaticImpl(
firDiagnostic as FirPsiDiagnostic,
token,
)
}
}
@@ -2803,4 +2803,8 @@ sealed class KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
override val diagnosticClass get() = InterfaceStaticMethodCallFromJava6TargetWarning::class
}
abstract class SubclassCantCallCompanionProtectedNonStatic : KtFirDiagnostic<PsiElement>() {
override val diagnosticClass get() = SubclassCantCallCompanionProtectedNonStatic::class
}
}
@@ -4559,3 +4559,10 @@ internal class InterfaceStaticMethodCallFromJava6TargetWarningImpl(
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}
internal class SubclassCantCallCompanionProtectedNonStaticImpl(
firDiagnostic: FirPsiDiagnostic,
override val token: ValidityToken,
) : KtFirDiagnostic.SubclassCantCallCompanionProtectedNonStatic(), KtAbstractFirDiagnostic<PsiElement> {
override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic)
}