K2: add inline JVM target version checker

#KT-60777 Fixed
This commit is contained in:
Alexander Udalov
2024-02-28 15:55:34 +01:00
committed by Space Team
parent d475371394
commit 3bb2ea10b6
19 changed files with 260 additions and 16 deletions
@@ -4884,6 +4884,14 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
token,
)
}
add(FirJvmErrors.INLINE_FROM_HIGHER_PLATFORM) { firDiagnostic ->
InlineFromHigherPlatformImpl(
firDiagnostic.a,
firDiagnostic.b,
firDiagnostic as KtPsiDiagnostic,
token,
)
}
add(FirErrors.CANNOT_ALL_UNDER_IMPORT_FROM_SINGLETON) { firDiagnostic ->
CannotAllUnderImportFromSingletonImpl(
firDiagnostic.a,
@@ -3401,6 +3401,12 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
val type: KtType
}
interface InlineFromHigherPlatform : KtFirDiagnostic<PsiElement> {
override val diagnosticClass get() = InlineFromHigherPlatform::class
val inlinedBytecodeVersion: String
val currentModuleBytecodeVersion: String
}
interface CannotAllUnderImportFromSingleton : KtFirDiagnostic<KtImportDirective> {
override val diagnosticClass get() = CannotAllUnderImportFromSingleton::class
val objectName: Name
@@ -4100,6 +4100,13 @@ internal class InefficientEqualsOverridingInValueClassImpl(
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<KtNamedFunction>(firDiagnostic, token), KtFirDiagnostic.InefficientEqualsOverridingInValueClass
internal class InlineFromHigherPlatformImpl(
override val inlinedBytecodeVersion: String,
override val currentModuleBytecodeVersion: String,
firDiagnostic: KtPsiDiagnostic,
token: KtLifetimeToken,
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.InlineFromHigherPlatform
internal class CannotAllUnderImportFromSingletonImpl(
override val objectName: Name,
firDiagnostic: KtPsiDiagnostic,