Search in sources :

Example 1 with AdditionalTypeChecker

use of org.jetbrains.kotlin.resolve.calls.checkers.AdditionalTypeChecker in project kotlin by JetBrains.

the class DataFlowAnalyzer method checkType.

@Nullable
public KotlinType checkType(@Nullable KotlinType expressionType, @NotNull KtExpression expressionToCheck, @NotNull ResolutionContext c, @Nullable Ref<Boolean> hasError) {
    if (hasError == null) {
        hasError = Ref.create(false);
    } else {
        hasError.set(false);
    }
    KtExpression expression = KtPsiUtil.safeDeparenthesize(expressionToCheck);
    recordExpectedType(c.trace, expression, c.expectedType);
    if (expressionType == null)
        return null;
    KotlinType result = checkTypeInternal(expressionType, expression, c, hasError);
    if (Boolean.FALSE.equals(hasError.get())) {
        for (AdditionalTypeChecker checker : additionalTypeCheckers) {
            checker.checkType(expression, expressionType, result, c);
        }
    }
    return result;
}
Also used : AdditionalTypeChecker(org.jetbrains.kotlin.resolve.calls.checkers.AdditionalTypeChecker) KotlinType(org.jetbrains.kotlin.types.KotlinType) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

Nullable (org.jetbrains.annotations.Nullable)1 AdditionalTypeChecker (org.jetbrains.kotlin.resolve.calls.checkers.AdditionalTypeChecker)1 KotlinType (org.jetbrains.kotlin.types.KotlinType)1