org.jetbrains.kotlin.resolve.calls
Class CallTransformer<D extends CallableDescriptor,F extends D>

java.lang.Object
  extended by org.jetbrains.kotlin.resolve.calls.CallTransformer<D,F>

public class CallTransformer<D extends CallableDescriptor,F extends D>
extends java.lang.Object

CallTransformer treats specially 'variable as function' call case, other cases keeps unchanged (base realization). For the call 'b.foo(1)' where foo is a variable that has method 'invoke' (for example of function type) CallTransformer creates two contexts, two calls in each, and performs second ('invoke') call resolution: context#1. calls: 'b.foo' 'invoke(1)' context#2. calls: 'foo' 'b.invoke(1)' If success VariableAsFunctionResolvedCall is created.


Nested Class Summary
static class CallTransformer.CallForImplicitInvoke
           
 
Field Summary
static CallTransformer<CallableDescriptor,FunctionDescriptor> FUNCTION_CALL_TRANSFORMER
           
static CallTransformer<CallableDescriptor,CallableDescriptor> MEMBER_CALL_TRANSFORMER
           
static CallTransformer<VariableDescriptor,VariableDescriptor> VARIABLE_CALL_TRANSFORMER
           
 
Method Summary
 java.util.Collection<CallCandidateResolutionContext<D>> createCallContexts(ResolutionCandidate<D> candidate, ResolutionTask<D,F> task, TemporaryBindingTrace candidateTrace, CandidateResolveMode candidateResolveMode)
          Returns two contexts for 'variable as function' case (in FUNCTION_CALL_TRANSFORMER), one context otherwise
static Call stripCallArguments(Call call)
           
static Call stripReceiver(Call variableCall)
           
 java.util.Collection<MutableResolvedCall<F>> transformCall(CallCandidateResolutionContext<D> callCandidateResolutionContext, CallResolver callResolver, ResolutionTask<D,F> task)
          Returns collection of resolved calls for 'invoke' for 'variable as function' case (in FUNCTION_CALL_TRANSFORMER), the resolved call from callCandidateResolutionContext otherwise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MEMBER_CALL_TRANSFORMER

public static CallTransformer<CallableDescriptor,CallableDescriptor> MEMBER_CALL_TRANSFORMER

VARIABLE_CALL_TRANSFORMER

public static CallTransformer<VariableDescriptor,VariableDescriptor> VARIABLE_CALL_TRANSFORMER

FUNCTION_CALL_TRANSFORMER

public static CallTransformer<CallableDescriptor,FunctionDescriptor> FUNCTION_CALL_TRANSFORMER
Method Detail

createCallContexts

@NotNull
public java.util.Collection<CallCandidateResolutionContext<D>> createCallContexts(@NotNull
                                                                                          ResolutionCandidate<D> candidate,
                                                                                          @NotNull
                                                                                          ResolutionTask<D,F> task,
                                                                                          @NotNull
                                                                                          TemporaryBindingTrace candidateTrace,
                                                                                          @NotNull
                                                                                          CandidateResolveMode candidateResolveMode)
Returns two contexts for 'variable as function' case (in FUNCTION_CALL_TRANSFORMER), one context otherwise


transformCall

@NotNull
public java.util.Collection<MutableResolvedCall<F>> transformCall(@NotNull
                                                                          CallCandidateResolutionContext<D> callCandidateResolutionContext,
                                                                          @NotNull
                                                                          CallResolver callResolver,
                                                                          @NotNull
                                                                          ResolutionTask<D,F> task)
Returns collection of resolved calls for 'invoke' for 'variable as function' case (in FUNCTION_CALL_TRANSFORMER), the resolved call from callCandidateResolutionContext otherwise


stripCallArguments

public static Call stripCallArguments(@NotNull
                                      Call call)

stripReceiver

public static Call stripReceiver(@NotNull
                                 Call variableCall)