org.jetbrains.kotlin.analysis.api.expressions¶
Properties¶
contextSensitiveResolutionStatus¶
context(session: KaSession)
val KtSimpleNameExpression.contextSensitiveResolutionStatus: KaContextSensitiveResolutionStatus
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¶
context(session: KaSession)
val KtExpression.isDefinitelyNotNull: Boolean
Whether this expression is definitely not null.
isDefinitelyNull¶
context(session: KaSession)
val KtExpression.isDefinitelyNull: Boolean
Whether this expression is definitely null, based on the declared nullability and smart cast types derived from data-flow analysis facts.
isImplicitReferenceToCompanion¶
context(session: KaSession)
val KtSimpleNameExpression.isImplicitReferenceToCompanion: Boolean
Checks if the KtSimpleNameExpression is an implicit reference to a companion object via the containing class.
isStableForSmartCasting¶
context(session: KaSession)
val KtExpression.isStableForSmartCasting: Boolean
Whether this expression can be used as a stable smart-cast sink at the current program point.
isUsedAsExpression¶
context(session: KaSession)
val KtExpression.isUsedAsExpression: Boolean
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¶
context(session: KaSession)
val KtExpression.isUsedAsResultOfLambda: Boolean
Whether the value of the given KtExpression is used as the resulting expression of some lambda block.
returnType¶
context(session: KaSession)
val KtDeclarationWithReturnType.returnType: KaType
The return type of the given KtDeclarationWithReturnType, either declared explicitly or inferred.