org.jetbrains.kotlin.fir.analysis.checkers.CommonDeclarationCheckers.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-compiler-embeddable Show documentation
Show all versions of kotlin-compiler-embeddable Show documentation
the Kotlin compiler embeddable
/*
* Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.fir.analysis.checkers
import org.jetbrains.kotlin.fir.analysis.cfa.AbstractFirPropertyInitializationChecker
import org.jetbrains.kotlin.fir.analysis.cfa.FirCallsEffectAnalyzer
import org.jetbrains.kotlin.fir.analysis.cfa.FirPropertyInitializationAnalyzer
import org.jetbrains.kotlin.fir.analysis.checkers.cfa.FirControlFlowChecker
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.*
import org.jetbrains.kotlin.fir.analysis.checkers.syntax.*
object CommonDeclarationCheckers : DeclarationCheckers() {
override val basicDeclarationCheckers: Set
get() = setOf(
FirModifierChecker,
FirConflictsDeclarationChecker,
FirTypeConstraintsChecker,
FirReservedUnderscoreDeclarationChecker,
FirUpperBoundViolatedDeclarationChecker,
FirInfixFunctionDeclarationChecker,
FirExposedVisibilityDeclarationChecker,
FirCyclicTypeBoundsChecker,
FirExpectActualDeclarationChecker,
FirAmbiguousAnonymousTypeChecker,
FirExplicitApiDeclarationChecker,
FirAnnotationChecker,
FirPublishedApiChecker,
FirContextReceiversDeprecatedDeclarationChecker,
FirOptInMarkedDeclarationChecker,
FirExpectConsistencyChecker,
FirOptionalExpectationDeclarationChecker,
FirMissingDependencySupertypeInDeclarationsChecker,
FirContextReceiversDeclarationChecker,
)
override val classLikeCheckers: Set
get() = setOf(
FirExpectActualClassifiersAreInBetaChecker,
)
override val callableDeclarationCheckers: Set
get() = setOf(
FirKClassWithIncorrectTypeArgumentChecker,
FirImplicitNothingReturnTypeChecker,
FirDynamicReceiverChecker,
FirExtensionShadowedByMemberChecker.Regular,
FirExtensionShadowedByMemberChecker.ForExpectDeclaration,
)
override val functionCheckers: Set
get() = setOf(
FirContractChecker,
FirFunctionParameterChecker,
FirFunctionReturnChecker,
FirInlineDeclarationChecker,
FirNonMemberFunctionsChecker,
FirSuspendLimitationsChecker,
)
override val simpleFunctionCheckers: Set
get() = setOf(
FirFunctionNameChecker,
FirFunctionTypeParametersSyntaxChecker,
FirOperatorModifierChecker,
FirTailrecFunctionChecker,
FirMemberFunctionsChecker,
FirDataObjectContentChecker,
ContractSyntaxV2FunctionChecker,
FirAnyDeprecationChecker,
)
override val propertyCheckers: Set
get() = setOf(
FirInapplicableLateinitChecker,
FirDestructuringDeclarationChecker,
FirConstPropertyChecker,
FirPropertyAccessorsTypesChecker,
FirPropertyTypeParametersChecker,
FirInitializerTypeMismatchChecker,
FirDelegatedPropertyChecker,
FirPropertyFieldTypeChecker,
FirPropertyFromParameterChecker,
FirLocalVariableTypeParametersSyntaxChecker,
FirDelegateUsesExtensionPropertyTypeParameterChecker,
FirLocalExtensionPropertyChecker,
ContractSyntaxV2PropertyChecker,
FirVolatileAnnotationChecker,
FirInlinePropertyChecker,
FirContextReceiversPropertyBackingFieldChecker
)
override val backingFieldCheckers: Set
get() = setOf(
FirExplicitBackingFieldForbiddenChecker,
FirExplicitBackingFieldsUnsupportedChecker,
)
override val classCheckers: Set
get() = setOf(
FirOverrideChecker.Regular,
FirOverrideChecker.ForExpectClass,
FirNotImplementedOverrideChecker,
FirNotImplementedOverrideSimpleEnumEntryChecker.Regular,
FirNotImplementedOverrideSimpleEnumEntryChecker.ForExpectClass,
FirThrowableSubclassChecker,
FirOpenMemberChecker,
FirClassVarianceChecker,
FirSealedSupertypeChecker,
FirMemberPropertiesChecker,
FirImplementationMismatchChecker.Regular,
FirImplementationMismatchChecker.ForExpectClass,
FirTypeParametersInObjectChecker,
FirSupertypesChecker,
FirPrimaryConstructorSuperTypeChecker,
FirDynamicSupertypeChecker,
FirDataClassConsistentDataCopyAnnotationChecker,
FirEnumCompanionInEnumConstructorCallChecker,
FirBadInheritedJavaSignaturesChecker,
FirSealedInterfaceAllowedChecker,
FirMixedFunctionalTypesInSupertypesChecker.Regular,
FirMixedFunctionalTypesInSupertypesChecker.ForExpectClass,
)
override val regularClassCheckers: Set
get() = setOf(
FirAnnotationClassDeclarationChecker,
FirOptInAnnotationClassChecker,
FirCommonConstructorDelegationIssuesChecker,
FirDelegationSuperCallInEnumConstructorChecker,
FirDelegationInExpectClassSyntaxChecker,
FirDelegationInInterfaceSyntaxChecker,
FirEnumClassSimpleChecker,
FirLocalEntityNotAllowedChecker,
FirManyCompanionObjectsChecker,
FirMethodOfAnyImplementedInInterfaceChecker,
FirDataClassPrimaryConstructorChecker,
FirDataClassNonPublicConstructorChecker,
FirFunInterfaceDeclarationChecker.Regular,
FirFunInterfaceDeclarationChecker.ForExpectClass,
FirNestedClassChecker,
FirValueClassDeclarationChecker.Regular,
FirValueClassDeclarationChecker.ForExpectClass,
FirOuterClassArgumentsRequiredChecker,
FirPropertyInitializationChecker,
FirDelegateFieldTypeMismatchChecker,
FirMultipleDefaultsInheritedFromSupertypesChecker.Regular,
FirMultipleDefaultsInheritedFromSupertypesChecker.ForExpectClass,
FirFiniteBoundRestrictionChecker,
FirNonExpansiveInheritanceRestrictionChecker,
FirObjectConstructorChecker,
FirInlineClassDeclarationChecker,
FirEnumEntryInitializationChecker,
)
override val constructorCheckers: Set
get() = setOf(
FirConstructorAllowedChecker,
FirMissingConstructorKeywordSyntaxChecker,
)
override val fileCheckers: Set
get() = setOf(
FirImportsChecker,
FirOptInImportsChecker,
FirUnresolvedInMiddleOfImportChecker,
FirTopLevelPropertiesChecker,
FirPackageConflictsWithClassifierChecker,
)
override val scriptCheckers: Set
get() = setOf(
FirScriptPropertiesChecker
)
override val controlFlowAnalyserCheckers: Set
get() = setOf(
FirCallsEffectAnalyzer,
)
override val variableAssignmentCfaBasedCheckers: Set
get() = setOf(
FirPropertyInitializationAnalyzer,
)
override val typeParameterCheckers: Set
get() = setOf(
FirTypeParameterBoundsChecker.Regular,
FirTypeParameterBoundsChecker.ForExpectClass,
FirTypeParameterVarianceChecker,
FirReifiedTypeParameterChecker,
FirTypeParameterSyntaxChecker,
)
override val typeAliasCheckers: Set
get() = setOf(
FirTopLevelTypeAliasChecker,
FirActualTypeAliasChecker,
FirActualTypealiasToSpecialAnnotationChecker,
FirDefaultArgumentsInExpectWithActualTypealiasChecker,
FirTypeAliasExpandsToArrayOfNothingsChecker,
)
override val anonymousFunctionCheckers: Set
get() = setOf(
FirAnonymousFunctionParametersChecker,
FirInlinedLambdaNonSourceAnnotationsChecker,
FirAnonymousFunctionSyntaxChecker,
FirSuspendAnonymousFunctionChecker,
FirMissingDependencyClassForLambdaReceiverChecker,
)
override val anonymousInitializerCheckers: Set
get() = setOf(
FirAnonymousInitializerInInterfaceChecker
)
override val valueParameterCheckers: Set
get() = setOf(
FirValueParameterDefaultValueTypeMismatchChecker,
FirMissingDependencyClassForParameterChecker,
)
override val enumEntryCheckers: Set
get() = setOf(
FirEnumEntriesRedeclarationChecker,
)
}