Skip to content

org.jetbrains.kotlin.analysis.api.expressions

Properties

contextSensitiveResolutionStatus

The context-sensitive resolution status of the KtSimpleNameExpression: whether the name is already resolved through context-sensitive resolution, and whether a redundant explicit qualifier or import could be removed in favor of it.

expectedType

context(session: KaSession)
val PsiElement.expectedType: KaType?

The expected KaType for the given PsiElement if it is an expression, or null if the element does not have an expected type. The expected type represents the type that is expected for an expression at a specific location in the code.

expressionType

context(session: KaSession)
val KtExpression.expressionType: KaType?

The type of the given KtExpression, or null if it does not have a type.

functionType

context(session: KaSession)
val KtFunction.functionType: KaType

The function type of the given KtFunction.

isDefinitelyNotNull

Whether this expression is definitely not null.

isDefinitelyNull

Whether this expression is definitely null, based on the declared nullability and smart cast types derived from data-flow analysis facts.

isImplicitReferenceToCompanion

Checks if the KtSimpleNameExpression is an implicit reference to a companion object via the containing class.

isStableForSmartCasting

Whether this expression can be used as a stable smart-cast sink at the current program point.

isUsedAsExpression

Whether the value of the given KtExpression is used. In other words, true if the value of the expression is not safe to discard.

isUsedAsResultOfLambda

Whether the value of the given KtExpression is used as the resulting expression of some lambda block.

returnType

The return type of the given KtDeclarationWithReturnType, either declared explicitly or inferred.