All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jetbrains.kotlin.fir.analysis.checkers.CommonExpressionCheckers.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0-RC
Show newest version
/*
 * 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.checkers.declaration.FirInlineBodyQualifiedAccessExpressionChecker
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirInlineBodyResolvedQualifierChecker
import org.jetbrains.kotlin.fir.analysis.checkers.declaration.FirInlineBodyVariableAssignmentChecker
import org.jetbrains.kotlin.fir.analysis.checkers.expression.*
import org.jetbrains.kotlin.fir.analysis.checkers.syntax.FirCommaInWhenConditionChecker
import org.jetbrains.kotlin.fir.analysis.checkers.syntax.FirConfusingWhenBranchSyntaxChecker
import org.jetbrains.kotlin.fir.analysis.checkers.syntax.FirUnderscoredTypeArgumentSyntaxChecker

object CommonExpressionCheckers : ExpressionCheckers() {
    override val annotationCallCheckers: Set
        get() = setOf(
            FirAnnotationExpressionChecker,
            FirOptInAnnotationCallChecker,
        )

    override val basicExpressionCheckers: Set
        get() = setOf(
            FirUnderscoreChecker,
            FirExpressionAnnotationChecker,
            FirDeprecationChecker,
            FirRecursiveProblemChecker,
            FirOptInUsageAccessChecker,
        )

    override val throwExpressionCheckers: Set
        get() = setOf(
            FirThrowExpressionTypeChecker,
        )

    override val qualifiedAccessExpressionCheckers: Set
        get() = setOf(
            FirCallableReferenceChecker,
            FirSuperReferenceChecker,
            FirSuperclassNotAccessibleFromInterfaceChecker,
            FirAbstractSuperCallChecker,
            FirQualifiedSupertypeExtendedByOtherSupertypeChecker,
            FirProjectionsOnNonClassTypeArgumentChecker,
            FirUpperBoundViolatedExpressionChecker,
            FirTypeArgumentsNotAllowedExpressionChecker,
            FirTypeParameterInQualifiedAccessChecker,
            FirSealedClassConstructorCallChecker,
            FirUninitializedEnumChecker,
            FirFunInterfaceConstructorReferenceChecker,
            FirReifiedChecker,
            FirSuspendCallChecker,
            FirLateinitIntrinsicApplicabilityChecker,
            FirAbstractClassInstantiationChecker,
            FirInlineBodyQualifiedAccessExpressionChecker,
        )

    override val callCheckers: Set
        get() = setOf(
            FirNamedVarargChecker,
        )

    override val functionCallCheckers: Set
        get() = setOf(
            FirConventionFunctionCallChecker,
            FirDivisionByZeroChecker,
            FirConstructorCallChecker,
            FirSpreadOfNullableChecker,
            FirAssignmentOperatorCallChecker,
            FirNamedVarargChecker,
            FirUnderscoredTypeArgumentSyntaxChecker,
            FirContractNotFirstStatementChecker,
            FirProtectedConstructorNotInSuperCallChecker,
        )

    override val propertyAccessExpressionCheckers: Set
        get() = setOf(
            FirPropertyAccessTypeArgumentsChecker,
        )

    override val tryExpressionCheckers: Set
        get() = setOf(
            FirCatchParameterChecker
        )

    override val variableAssignmentCheckers: Set
        get() = setOf(
            FirReassignmentAndInvisibleSetterChecker,
            FirAssignmentTypeMismatchChecker,
            FirInlineBodyVariableAssignmentChecker,
        )

    override val whenExpressionCheckers: Set
        get() = setOf(
            FirExhaustiveWhenChecker,
            FirWhenConditionChecker,
            FirWhenSubjectChecker,
            FirCommaInWhenConditionChecker,
            FirConfusingWhenBranchSyntaxChecker,
        )

    override val loopExpressionCheckers: Set
        get() = setOf(
            FirLoopConditionChecker,
        )

    override val loopJumpCheckers: Set
        get() = setOf(
            FirBreakOrContinueJumpsAcrossFunctionBoundaryChecker
        )

    override val logicExpressionCheckers: Set
        get() = setOf(
            FirLogicExpressionTypeChecker,
        )

    override val returnExpressionCheckers: Set
        get() = setOf(
            FirReturnSyntaxAndLabelChecker,
            FirFunctionReturnTypeMismatchChecker
        )

    override val blockCheckers: Set
        get() = setOf(
            FirForLoopChecker,
            FirConflictsExpressionChecker
        )

    override val checkNotNullCallCheckers: Set
        get() = setOf(
            FirNotNullAssertionChecker,
        )

    override val elvisExpressionCheckers: Set
        get() = setOf(
            FirUselessElvisChecker,
        )

    override val getClassCallCheckers: Set
        get() = setOf(
            FirClassLiteralChecker,
        )

    override val safeCallExpressionCheckers: Set
        get() = setOf(
            FirUnnecessarySafeCallChecker,
        )

    override val typeOperatorCallCheckers: Set
        get() = setOf(
            FirUselessTypeOperationCallChecker,
            FirCastOperatorsChecker
        )

    override val resolvedQualifierCheckers: Set
        get() = setOf(
            FirStandaloneQualifierChecker,
            FirOptInUsageQualifierChecker,
            FirDeprecatedQualifierChecker,
            FirVisibilityQualifierChecker,
            FirInlineBodyResolvedQualifierChecker,
        )

    override val equalityOperatorCallCheckers: Set
        get() = setOf(
            FirEqualityCompatibilityChecker,
        )

    override val arrayLiteralCheckers: Set
        get() = setOf(
            FirUnsupportedArrayLiteralChecker
        )

    override val inaccessibleReceiverCheckers: Set
        get() = setOf(
            FirReceiverAccessBeforeSuperCallChecker,
        )

    override val callableReferenceAccessCheckers: Set
        get() = setOf(
            FirTypeArgumentsOfQualifierOfCallableReferenceChecker,
        )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy