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

java.lang.Object
  extended by org.jetbrains.jet.lang.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<VariableDescriptor,VariableDescriptor> PROPERTY_CALL_TRANSFORMER
           
 
Method Summary
 java.util.Collection<CallCandidateResolutionContext<D>> createCallContexts(ResolutionCandidate<D> candidate, ResolutionTask<D,F> task, TemporaryBindingTrace candidateTrace)
          Returns two contexts for 'variable as function' case (in FUNCTION_CALL_TRANSFORMER), one context otherwise
 java.util.Collection<ResolvedCallWithTrace<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

PROPERTY_CALL_TRANSFORMER

public static CallTransformer<VariableDescriptor,VariableDescriptor> PROPERTY_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)
Returns two contexts for 'variable as function' case (in FUNCTION_CALL_TRANSFORMER), one context otherwise


transformCall

@NotNull
public java.util.Collection<ResolvedCallWithTrace<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