K2: report PRE_RELEASE_CLASS on JVM
Note that 3 tests are still muted, but for another reason: for FIR versions of the tests, we need to compile the "pre-release library" with the next language version which is 2.1. But since currently LanguageVersion.LATEST_STABLE is 1.9, the compiler refuses to read metadata of version 2.1, regardless of its own language version. Which is correct, but it leads to irrelevant errors in the test output -- the ones about the incompatible metadata version, NOT about the prereleaseness. These 3 tests can be unmuted once the default language version is switched to 2.0. #KT-60780 Fixed
This commit is contained in:
committed by
Space Team
parent
8738ffb84f
commit
fec2d063c1
+7
@@ -5306,6 +5306,13 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJvmErrors.PRE_RELEASE_CLASS) { firDiagnostic ->
|
||||
PreReleaseClassImpl(
|
||||
firDiagnostic.a,
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
token,
|
||||
)
|
||||
}
|
||||
add(FirJsErrors.IMPLEMENTING_FUNCTION_INTERFACE) { firDiagnostic ->
|
||||
ImplementingFunctionInterfaceImpl(
|
||||
firDiagnostic as KtPsiDiagnostic,
|
||||
|
||||
+5
@@ -3698,6 +3698,11 @@ sealed interface KtFirDiagnostic<PSI : PsiElement> : KtDiagnosticWithPsi<PSI> {
|
||||
val incompatibility: IncompatibleVersionErrorData<*>
|
||||
}
|
||||
|
||||
interface PreReleaseClass : KtFirDiagnostic<PsiElement> {
|
||||
override val diagnosticClass get() = PreReleaseClass::class
|
||||
val presentableString: String
|
||||
}
|
||||
|
||||
interface ImplementingFunctionInterface : KtFirDiagnostic<KtClassOrObject> {
|
||||
override val diagnosticClass get() = ImplementingFunctionInterface::class
|
||||
}
|
||||
|
||||
+6
@@ -4469,6 +4469,12 @@ internal class IncompatibleClassImpl(
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.IncompatibleClass
|
||||
|
||||
internal class PreReleaseClassImpl(
|
||||
override val presentableString: String,
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
) : KtAbstractFirDiagnostic<PsiElement>(firDiagnostic, token), KtFirDiagnostic.PreReleaseClass
|
||||
|
||||
internal class ImplementingFunctionInterfaceImpl(
|
||||
firDiagnostic: KtPsiDiagnostic,
|
||||
token: KtLifetimeToken,
|
||||
|
||||
Reference in New Issue
Block a user