K2 JVM: implement Java modules-related checkers
All existing tests use custom test data for FIR because the diagnostic text in FIR has to have a dot at the end. Also, the K2 checker doesn't check usages in imports because there are no "import checkers" in K2 right now, this will need to be fixed later if necessary. #KT-60797 Fixed
This commit is contained in:
committed by
Space Team
parent
ac901c6d07
commit
5ca7ab9801
+13
-6
@@ -7,20 +7,16 @@ package org.jetbrains.kotlin.fir.checkers.generator.diagnostics
|
||||
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.config.LanguageFeature.*
|
||||
import org.jetbrains.kotlin.diagnostics.Severity
|
||||
import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.model.DiagnosticList
|
||||
import org.jetbrains.kotlin.fir.checkers.generator.diagnostics.model.PositioningStrategy
|
||||
import org.jetbrains.kotlin.fir.expressions.FirExpression
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol
|
||||
import org.jetbrains.kotlin.fir.symbols.impl.FirNamedFunctionSymbol
|
||||
import org.jetbrains.kotlin.fir.types.ConeKotlinType
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
import org.jetbrains.kotlin.psi.KtAnnotationEntry
|
||||
import org.jetbrains.kotlin.psi.KtDeclaration
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
import org.jetbrains.kotlin.psi.KtNamedFunction
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.util.PrivateForInline
|
||||
|
||||
@Suppress("ClassName", "unused")
|
||||
@@ -135,6 +131,17 @@ object JVM_DIAGNOSTICS_LIST : DiagnosticList("FirJvmErrors") {
|
||||
val ILLEGAL_JAVA_LANG_RECORD_SUPERTYPE by error<PsiElement>()
|
||||
}
|
||||
|
||||
val MODULES by object : DiagnosticGroup("JVM Modules") {
|
||||
val JAVA_MODULE_DOES_NOT_DEPEND_ON_MODULE by error<PsiElement> {
|
||||
parameter<String>("moduleName")
|
||||
}
|
||||
val JAVA_MODULE_DOES_NOT_READ_UNNAMED_MODULE by error<PsiElement>()
|
||||
val JAVA_MODULE_DOES_NOT_EXPORT_PACKAGE by error<PsiElement>() {
|
||||
parameter<String>("moduleName")
|
||||
parameter<String>("packageName")
|
||||
}
|
||||
}
|
||||
|
||||
val JVM_DEFAULT by object : DiagnosticGroup("JVM Default") {
|
||||
val JVM_DEFAULT_IN_DECLARATION by error<KtElement>(PositioningStrategy.DECLARATION_SIGNATURE_OR_DEFAULT) {
|
||||
parameter<String>("annotation")
|
||||
|
||||
Reference in New Issue
Block a user