org.jetbrains.kotlin.resolve.calls.context
Class ResolutionContext<Context extends ResolutionContext<Context>>
java.lang.Object
org.jetbrains.kotlin.resolve.calls.context.ResolutionContext<Context>
- Direct Known Subclasses:
- CallResolutionContext, ExpressionTypingContext
public abstract class ResolutionContext<Context extends ResolutionContext<Context>>
- extends java.lang.Object
This class together with its descendants is intended to transfer data flow analysis information
in top-down direction, from AST parents to children.
NB: all descendants must be immutable!
|
Constructor Summary |
protected |
ResolutionContext(BindingTrace trace,
LexicalScope scope,
KotlinType expectedType,
DataFlowInfo dataFlowInfo,
ContextDependency contextDependency,
ResolutionResultsCache resolutionResultsCache,
StatementFilter statementFilter,
boolean isAnnotationContext,
boolean isDebuggerContext,
boolean collectAllCandidates,
CallPosition callPosition,
kotlin.jvm.functions.Function1<KtExpression,KtExpression> expressionContextProvider)
|
|
Method Summary |
protected abstract Context |
create(BindingTrace trace,
LexicalScope scope,
DataFlowInfo dataFlowInfo,
KotlinType expectedType,
ContextDependency contextDependency,
ResolutionResultsCache resolutionResultsCache,
StatementFilter statementFilter,
boolean collectAllCandidates,
CallPosition callPosition,
kotlin.jvm.functions.Function1<KtExpression,KtExpression> expressionContextProvider)
|
<T extends com.intellij.psi.PsiElement>
T |
|
getContextParentOfType(KtExpression expression,
java.lang.Class<? extends T>... classes)
|
Context |
replaceBindingTrace(BindingTrace trace)
|
Context |
replaceCallPosition(CallPosition callPosition)
|
Context |
replaceCollectAllCandidates(boolean newCollectAllCandidates)
|
Context |
replaceContextDependency(ContextDependency newContextDependency)
|
Context |
replaceDataFlowInfo(DataFlowInfo newDataFlowInfo)
|
Context |
replaceExpectedType(KotlinType newExpectedType)
|
Context |
replaceExpressionContextProvider(kotlin.jvm.functions.Function1<KtExpression,KtExpression> expressionContextProvider)
|
Context |
replaceResolutionResultsCache(ResolutionResultsCache newResolutionResultsCache)
|
Context |
replaceScope(LexicalScope newScope)
|
Context |
replaceStatementFilter(StatementFilter statementFilter)
|
Context |
replaceTraceAndCache(TemporaryTraceAndCache traceAndCache)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
trace
@NotNull
public final BindingTrace trace
scope
@NotNull
public final LexicalScope scope
expectedType
@NotNull
public final KotlinType expectedType
dataFlowInfo
@NotNull
public final DataFlowInfo dataFlowInfo
contextDependency
@NotNull
public final ContextDependency contextDependency
resolutionResultsCache
@NotNull
public final ResolutionResultsCache resolutionResultsCache
statementFilter
@NotNull
public final StatementFilter statementFilter
isAnnotationContext
public final boolean isAnnotationContext
isDebuggerContext
public final boolean isDebuggerContext
collectAllCandidates
public final boolean collectAllCandidates
callPosition
@NotNull
public final CallPosition callPosition
expressionContextProvider
@NotNull
public final kotlin.jvm.functions.Function1<KtExpression,KtExpression> expressionContextProvider
- Used for analyzing expression in the given context.
Should be used for going through parents to find containing function, loop etc.
The provider should return specific context expression (which can be used instead of parent)
for the given expression or null otherwise.
- See Also:
getContextParentOfType(org.jetbrains.kotlin.psi.KtExpression, java.lang.Class extends T>...)
DEFAULT_EXPRESSION_CONTEXT_PROVIDER
public static final kotlin.jvm.functions.Function1<KtExpression,KtExpression> DEFAULT_EXPRESSION_CONTEXT_PROVIDER
ResolutionContext
protected ResolutionContext(@NotNull
BindingTrace trace,
@NotNull
LexicalScope scope,
@NotNull
KotlinType expectedType,
@NotNull
DataFlowInfo dataFlowInfo,
@NotNull
ContextDependency contextDependency,
@NotNull
ResolutionResultsCache resolutionResultsCache,
@NotNull
StatementFilter statementFilter,
boolean isAnnotationContext,
boolean isDebuggerContext,
boolean collectAllCandidates,
@NotNull
CallPosition callPosition,
@NotNull
kotlin.jvm.functions.Function1<KtExpression,KtExpression> expressionContextProvider)
create
protected abstract Context create(@NotNull
BindingTrace trace,
@NotNull
LexicalScope scope,
@NotNull
DataFlowInfo dataFlowInfo,
@NotNull
KotlinType expectedType,
@NotNull
ContextDependency contextDependency,
@NotNull
ResolutionResultsCache resolutionResultsCache,
@NotNull
StatementFilter statementFilter,
boolean collectAllCandidates,
@NotNull
CallPosition callPosition,
@NotNull
kotlin.jvm.functions.Function1<KtExpression,KtExpression> expressionContextProvider)
replaceBindingTrace
@NotNull
public Context replaceBindingTrace(@NotNull
BindingTrace trace)
replaceDataFlowInfo
@NotNull
public Context replaceDataFlowInfo(@NotNull
DataFlowInfo newDataFlowInfo)
replaceExpectedType
@NotNull
public Context replaceExpectedType(@Nullable
KotlinType newExpectedType)
replaceScope
@NotNull
public Context replaceScope(@NotNull
LexicalScope newScope)
replaceContextDependency
@NotNull
public Context replaceContextDependency(@NotNull
ContextDependency newContextDependency)
replaceResolutionResultsCache
@NotNull
public Context replaceResolutionResultsCache(@NotNull
ResolutionResultsCache newResolutionResultsCache)
replaceTraceAndCache
@NotNull
public Context replaceTraceAndCache(@NotNull
TemporaryTraceAndCache traceAndCache)
replaceCollectAllCandidates
@NotNull
public Context replaceCollectAllCandidates(boolean newCollectAllCandidates)
replaceStatementFilter
@NotNull
public Context replaceStatementFilter(@NotNull
StatementFilter statementFilter)
replaceCallPosition
@NotNull
public Context replaceCallPosition(@NotNull
CallPosition callPosition)
replaceExpressionContextProvider
@NotNull
public Context replaceExpressionContextProvider(@NotNull
kotlin.jvm.functions.Function1<KtExpression,KtExpression> expressionContextProvider)
getContextParentOfType
@Nullable
public <T extends com.intellij.psi.PsiElement> T getContextParentOfType(@NotNull
KtExpression expression,
@NotNull
java.lang.Class<? extends T>... classes)