added tracing parameter to ResolvedCallImpl
This commit is contained in:
@@ -53,7 +53,7 @@ public class CallResolverUtil {
|
||||
call.isSafeCall());
|
||||
|
||||
TemporaryBindingTrace trace = TemporaryBindingTrace.create(context.trace, call.getTrace().toString() + "(copy)");
|
||||
ResolvedCallImpl<D> copy = ResolvedCallImpl.create(candidate, trace);
|
||||
ResolvedCallImpl<D> copy = ResolvedCallImpl.create(candidate, trace, call.getTracing());
|
||||
|
||||
call.getTrace().addAllMyDataTo(trace);
|
||||
trace.record(BindingContext.RESOLVED_CALL, context.call.getCalleeExpression(), copy);
|
||||
|
||||
@@ -68,7 +68,7 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
|
||||
@NotNull ResolutionTask<D, F> task,
|
||||
@NotNull TemporaryBindingTrace candidateTrace) {
|
||||
|
||||
ResolvedCallImpl<D> candidateCall = ResolvedCallImpl.create(candidate, candidateTrace);
|
||||
ResolvedCallImpl<D> candidateCall = ResolvedCallImpl.create(candidate, candidateTrace, task.tracing);
|
||||
return Collections.singleton(CallCandidateResolutionContext.create(candidateCall, task, candidateTrace, task.tracing));
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
|
||||
Call variableCall = stripCallArguments(task);
|
||||
if (!hasReceiver) {
|
||||
CallCandidateResolutionContext<CallableDescriptor> context = CallCandidateResolutionContext.create(
|
||||
ResolvedCallImpl.create(candidate, candidateTrace), task, candidateTrace, task.tracing, variableCall);
|
||||
ResolvedCallImpl.create(candidate, candidateTrace, task.tracing), task, candidateTrace, task.tracing, variableCall);
|
||||
return Collections.singleton(context);
|
||||
}
|
||||
Call variableCallWithoutReceiver = stripReceiver(variableCall);
|
||||
@@ -125,7 +125,7 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
|
||||
Call call, TemporaryBindingTrace temporaryTrace, ResolutionTask<CallableDescriptor, FunctionDescriptor> task) {
|
||||
|
||||
ChainedTemporaryBindingTrace chainedTrace = ChainedTemporaryBindingTrace.create(temporaryTrace, "chained trace to resolve candidate", candidate);
|
||||
ResolvedCallImpl<CallableDescriptor> resolvedCall = ResolvedCallImpl.create(candidate, chainedTrace);
|
||||
ResolvedCallImpl<CallableDescriptor> resolvedCall = ResolvedCallImpl.create(candidate, chainedTrace, task.tracing);
|
||||
return CallCandidateResolutionContext.create(resolvedCall, task, chainedTrace, task.tracing, call);
|
||||
}
|
||||
|
||||
|
||||
+12
-3
@@ -29,6 +29,7 @@ import org.jetbrains.jet.lang.resolve.calls.tasks.ExplicitReceiverKind;
|
||||
import org.jetbrains.jet.lang.resolve.calls.tasks.ResolutionCandidate;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.ResolutionStatus;
|
||||
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystem;
|
||||
import org.jetbrains.jet.lang.resolve.calls.tasks.TracingStrategy;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeSubstitutor;
|
||||
@@ -56,8 +57,9 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
||||
};
|
||||
|
||||
@NotNull
|
||||
public static <D extends CallableDescriptor> ResolvedCallImpl<D> create(@NotNull ResolutionCandidate<D> candidate, @NotNull DelegatingBindingTrace trace) {
|
||||
return new ResolvedCallImpl<D>(candidate, trace);
|
||||
public static <D extends CallableDescriptor> ResolvedCallImpl<D> create(@NotNull ResolutionCandidate<D> candidate, @NotNull DelegatingBindingTrace trace,
|
||||
@NotNull TracingStrategy tracing) {
|
||||
return new ResolvedCallImpl<D>(candidate, trace, tracing);
|
||||
}
|
||||
|
||||
private final D candidateDescriptor;
|
||||
@@ -71,18 +73,20 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
||||
private final Map<ValueParameterDescriptor, ResolvedValueArgument> valueArguments = Maps.newLinkedHashMap();
|
||||
private boolean someArgumentHasNoType = false;
|
||||
private final DelegatingBindingTrace trace;
|
||||
private final TracingStrategy tracing;
|
||||
private ResolutionStatus status = UNKNOWN_STATUS;
|
||||
private boolean hasUnknownTypeParameters = false;
|
||||
private ConstraintSystem constraintSystem = null;
|
||||
private DataFlowInfo dataFlowInfo;
|
||||
|
||||
private ResolvedCallImpl(@NotNull ResolutionCandidate<D> candidate, @NotNull DelegatingBindingTrace trace) {
|
||||
private ResolvedCallImpl(@NotNull ResolutionCandidate<D> candidate, @NotNull DelegatingBindingTrace trace, @NotNull TracingStrategy tracing) {
|
||||
this.candidateDescriptor = candidate.getDescriptor();
|
||||
this.thisObject = candidate.getThisObject();
|
||||
this.receiverArgument = candidate.getReceiverArgument();
|
||||
this.explicitReceiverKind = candidate.getExplicitReceiverKind();
|
||||
this.isSafeCall = candidate.isSafeCall();
|
||||
this.trace = trace;
|
||||
this.tracing = tracing;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,6 +114,11 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedC
|
||||
return trace;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public TracingStrategy getTracing() {
|
||||
return tracing;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public D getCandidateDescriptor() {
|
||||
|
||||
@@ -28,6 +28,7 @@ import org.jetbrains.jet.lang.resolve.calls.tasks.ExplicitReceiverKind;
|
||||
import org.jetbrains.jet.lang.resolve.calls.tasks.ResolutionCandidate;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallImpl;
|
||||
import org.jetbrains.jet.lang.resolve.calls.tasks.TracingStrategy;
|
||||
import org.jetbrains.k2js.translate.context.TranslationContext;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -108,7 +109,8 @@ public final class CallBuilder {
|
||||
resolvedCall = ResolvedCallImpl.create(ResolutionCandidate.create(descriptor, DescriptorUtils.safeGetValue(descriptor.getExpectedThisObject()),
|
||||
DescriptorUtils.safeGetValue(descriptor.getReceiverParameter()),
|
||||
ExplicitReceiverKind.THIS_OBJECT, false),
|
||||
TemporaryBindingTrace.create(new BindingTraceContext(), "trace to resolve call (in js)"));
|
||||
TemporaryBindingTrace.create(new BindingTraceContext(), "trace to resolve call (in js)"),
|
||||
TracingStrategy.EMPTY);
|
||||
}
|
||||
if (descriptor == null) {
|
||||
descriptor = resolvedCall.getCandidateDescriptor().getOriginal();
|
||||
|
||||
Reference in New Issue
Block a user