Rename: ResolvedCallWithTrace -> MutableResolvedCall
This commit is contained in:
@@ -33,9 +33,7 @@ import org.jetbrains.jet.lang.resolve.calls.context.CheckValueArgumentsMode;
|
||||
import org.jetbrains.jet.lang.resolve.calls.context.ResolutionContext;
|
||||
import org.jetbrains.jet.lang.resolve.calls.context.TemporaryTraceAndCache;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsImpl;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsUtil;
|
||||
import org.jetbrains.jet.lang.resolve.calls.util.CallMaker;
|
||||
import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant;
|
||||
|
||||
@@ -28,9 +28,9 @@ import org.jetbrains.jet.lang.resolve.*;
|
||||
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
||||
import org.jetbrains.jet.lang.resolve.calls.context.*;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableDataFlowInfoForArguments;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
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.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsImpl;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.ResolutionDebugInfo;
|
||||
@@ -394,7 +394,7 @@ public class CallResolver {
|
||||
return results;
|
||||
}
|
||||
|
||||
ResolvedCallWithTrace<D> resolvedCall = results.getResultingCall();
|
||||
MutableResolvedCall<D> resolvedCall = results.getResultingCall();
|
||||
ResolvedCallImpl<D> callToCompleteInference = resolvedCall.getCallToCompleteTypeArgumentInference();
|
||||
|
||||
Set<ValueArgument> unmappedArguments = callToCompleteInference.getUnmappedArguments();
|
||||
@@ -431,7 +431,7 @@ public class CallResolver {
|
||||
context.resolutionResultsCache.recordResolutionTrace(callKey, deltasTraceToCacheResolve);
|
||||
|
||||
if (results.isSingleResult()) {
|
||||
ResolvedCallWithTrace<F> resultingCall = results.getResultingCall();
|
||||
MutableResolvedCall<F> resultingCall = results.getResultingCall();
|
||||
CallCandidateResolutionContext<F> contextForCallToCompleteTypeArgumentInference = CallCandidateResolutionContext.createForCallBeingAnalyzed(
|
||||
results.getResultingCall().getCallToCompleteTypeArgumentInference(), context, tracing);
|
||||
context.resolutionResultsCache.recordDeferredComputationForCall(callKey, resultingCall, contextForCallToCompleteTypeArgumentInference);
|
||||
@@ -597,9 +597,9 @@ public class CallResolver {
|
||||
to have a binding to variable while 'invoke' call resolve */
|
||||
task.tracing.bindReference(context.candidateCall.getTrace(), context.candidateCall);
|
||||
|
||||
Collection<ResolvedCallWithTrace<F>> calls = callTransformer.transformCall(context, this, task);
|
||||
Collection<MutableResolvedCall<F>> calls = callTransformer.transformCall(context, this, task);
|
||||
|
||||
for (ResolvedCallWithTrace<F> call : calls) {
|
||||
for (MutableResolvedCall<F> call : calls) {
|
||||
task.tracing.bindReference(call.getTrace(), call);
|
||||
task.tracing.bindResolvedCall(call.getTrace(), call);
|
||||
task.addResolvedCall(call);
|
||||
|
||||
@@ -21,7 +21,6 @@ import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.FunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.VariableDescriptor;
|
||||
@@ -32,8 +31,8 @@ import org.jetbrains.jet.lang.resolve.TemporaryBindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.context.BasicCallResolutionContext;
|
||||
import org.jetbrains.jet.lang.resolve.calls.context.CallCandidateResolutionContext;
|
||||
import org.jetbrains.jet.lang.resolve.calls.context.ContextDependency;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallImpl;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsImpl;
|
||||
@@ -81,11 +80,11 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
|
||||
* the resolved call from callCandidateResolutionContext otherwise
|
||||
*/
|
||||
@NotNull
|
||||
public Collection<ResolvedCallWithTrace<F>> transformCall(@NotNull CallCandidateResolutionContext<D> callCandidateResolutionContext,
|
||||
public Collection<MutableResolvedCall<F>> transformCall(@NotNull CallCandidateResolutionContext<D> callCandidateResolutionContext,
|
||||
@NotNull CallResolver callResolver,
|
||||
@NotNull ResolutionTask<D, F> task
|
||||
) {
|
||||
return Collections.singleton((ResolvedCallWithTrace<F>) callCandidateResolutionContext.candidateCall);
|
||||
return Collections.singleton((MutableResolvedCall<F>) callCandidateResolutionContext.candidateCall);
|
||||
}
|
||||
|
||||
|
||||
@@ -177,7 +176,7 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Collection<ResolvedCallWithTrace<FunctionDescriptor>> transformCall(
|
||||
public Collection<MutableResolvedCall<FunctionDescriptor>> transformCall(
|
||||
@NotNull CallCandidateResolutionContext<CallableDescriptor> context,
|
||||
@NotNull CallResolver callResolver,
|
||||
@NotNull ResolutionTask<CallableDescriptor, FunctionDescriptor> task
|
||||
@@ -193,7 +192,7 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
final ResolvedCallWithTrace<VariableDescriptor> variableResolvedCall = (ResolvedCallWithTrace)context.candidateCall;
|
||||
final MutableResolvedCall<VariableDescriptor> variableResolvedCall = (MutableResolvedCall)context.candidateCall;
|
||||
|
||||
JetExpression calleeExpression = task.call.getCalleeExpression();
|
||||
if (calleeExpression == null) return Collections.emptyList();
|
||||
@@ -211,11 +210,11 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
|
||||
calleeExpression, functionCall, variableReceiver.getType());
|
||||
OverloadResolutionResults<FunctionDescriptor> results = callResolver.resolveCallForInvoke(
|
||||
basicCallResolutionContext, tracingForInvoke);
|
||||
Collection<ResolvedCallWithTrace<FunctionDescriptor>> calls = ((OverloadResolutionResultsImpl<FunctionDescriptor>)results).getResultingCalls();
|
||||
Collection<MutableResolvedCall<FunctionDescriptor>> calls = ((OverloadResolutionResultsImpl<FunctionDescriptor>)results).getResultingCalls();
|
||||
|
||||
return Collections2.transform(calls, new Function<ResolvedCallWithTrace<FunctionDescriptor>, ResolvedCallWithTrace<FunctionDescriptor>>() {
|
||||
return Collections2.transform(calls, new Function<MutableResolvedCall<FunctionDescriptor>, MutableResolvedCall<FunctionDescriptor>>() {
|
||||
@Override
|
||||
public ResolvedCallWithTrace<FunctionDescriptor> apply(ResolvedCallWithTrace<FunctionDescriptor> functionResolvedCall) {
|
||||
public MutableResolvedCall<FunctionDescriptor> apply(MutableResolvedCall<FunctionDescriptor> functionResolvedCall) {
|
||||
return new VariableAsFunctionResolvedCall(functionResolvedCall, variableResolvedCall);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -293,18 +293,18 @@ public class CandidateResolver {
|
||||
candidates = results.getResultingCalls();
|
||||
}
|
||||
for (ResolvedCall<D> resolvedCall : candidates) {
|
||||
ResolvedCallWithTrace<D> resolvedCallWithTrace = (ResolvedCallWithTrace<D>) resolvedCall;
|
||||
if (resolvedCallWithTrace.isCompleted()) continue;
|
||||
MutableResolvedCall<D> mutableResolvedCall = (MutableResolvedCall<D>) resolvedCall;
|
||||
if (mutableResolvedCall.isCompleted()) continue;
|
||||
|
||||
TemporaryBindingTrace temporaryBindingTrace = TemporaryBindingTrace.create(
|
||||
context.trace, "Trace to complete a candidate that is not a resulting call");
|
||||
ResolvedCallImpl<D> callToCompleteInference = resolvedCallWithTrace.getCallToCompleteTypeArgumentInference();
|
||||
ResolvedCallImpl<D> callToCompleteInference = mutableResolvedCall.getCallToCompleteTypeArgumentInference();
|
||||
|
||||
CallCandidateResolutionContext<D> callCandidateResolutionContext = CallCandidateResolutionContext.createForCallBeingAnalyzed(
|
||||
callToCompleteInference, context.replaceBindingTrace(temporaryBindingTrace), TracingStrategy.EMPTY);
|
||||
|
||||
completeTypeInferenceDependentOnExpectedTypeForCall(callCandidateResolutionContext, false);
|
||||
resolvedCallWithTrace.markCallAsCompleted();
|
||||
mutableResolvedCall.markCallAsCompleted();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -477,7 +477,7 @@ public class CandidateResolver {
|
||||
storedContextForArgument.candidateCall.markCallAsCompleted();
|
||||
|
||||
// clean data for "invoke" calls
|
||||
ResolvedCallWithTrace<?> resolvedCall = context.resolutionResultsCache.getCallForArgument(keyExpression);
|
||||
MutableResolvedCall<?> resolvedCall = context.resolutionResultsCache.getCallForArgument(keyExpression);
|
||||
assert resolvedCall != null : "Resolved call for '" + keyExpression + "' is not stored, but CallCandidateResolutionContext is.";
|
||||
resolvedCall.markCallAsCompleted();
|
||||
}
|
||||
|
||||
+3
-3
@@ -22,7 +22,7 @@ import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.CallKey;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.lang.resolve.DelegatingBindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsImpl;
|
||||
|
||||
public interface ResolutionResultsCache {
|
||||
@@ -40,7 +40,7 @@ public interface ResolutionResultsCache {
|
||||
//For VariableAsFunctionCall deferredComputation is taken for its function call, but resolvedCall is the VariableAsFunctionCall itself.
|
||||
<D extends CallableDescriptor> void recordDeferredComputationForCall(
|
||||
@NotNull CallKey callKey,
|
||||
@NotNull ResolvedCallWithTrace<D> resolvedCall,
|
||||
@NotNull MutableResolvedCall<D> resolvedCall,
|
||||
@NotNull CallCandidateResolutionContext<D> deferredComputation
|
||||
);
|
||||
|
||||
@@ -48,5 +48,5 @@ public interface ResolutionResultsCache {
|
||||
CallCandidateResolutionContext<?> getDeferredComputation(@Nullable JetExpression expression);
|
||||
|
||||
@Nullable
|
||||
ResolvedCallWithTrace<?> getCallForArgument(@Nullable JetExpression expression);
|
||||
MutableResolvedCall<?> getCallForArgument(@Nullable JetExpression expression);
|
||||
}
|
||||
|
||||
+4
-4
@@ -24,7 +24,7 @@ import org.jetbrains.jet.lang.psi.CallKey;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.DelegatingBindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsImpl;
|
||||
import org.jetbrains.jet.util.slicedmap.BasicWritableSlice;
|
||||
import org.jetbrains.jet.util.slicedmap.Slices;
|
||||
@@ -37,7 +37,7 @@ public class ResolutionResultsCacheImpl implements ResolutionResultsCache {
|
||||
public static final WritableSlice<CallKey, OverloadResolutionResultsImpl<CallableDescriptor>> RESOLUTION_RESULTS = Slices.createSimpleSlice();
|
||||
public static final WritableSlice<CallKey, DelegatingBindingTrace> TRACE_DELTAS_CACHE = Slices.createSimpleSlice();
|
||||
public static final WritableSlice<CallKey, CallCandidateResolutionContext<?>> DEFERRED_COMPUTATION_FOR_CALL = Slices.createSimpleSlice();
|
||||
public static final WritableSlice<CallKey, ResolvedCallWithTrace<?>> RESOLVED_CALL_FOR_ARGUMENT = Slices.createSimpleSlice();
|
||||
public static final WritableSlice<CallKey, MutableResolvedCall<?>> RESOLVED_CALL_FOR_ARGUMENT = Slices.createSimpleSlice();
|
||||
|
||||
static {
|
||||
BasicWritableSlice.initSliceDebugNames(ResolutionResultsCacheImpl.class);
|
||||
@@ -78,7 +78,7 @@ public class ResolutionResultsCacheImpl implements ResolutionResultsCache {
|
||||
@Override
|
||||
public <D extends CallableDescriptor> void recordDeferredComputationForCall(
|
||||
@NotNull CallKey callKey,
|
||||
@NotNull ResolvedCallWithTrace<D> resolvedCall,
|
||||
@NotNull MutableResolvedCall<D> resolvedCall,
|
||||
@NotNull CallCandidateResolutionContext<D> deferredComputation
|
||||
) {
|
||||
trace.record(DEFERRED_COMPUTATION_FOR_CALL, callKey, deferredComputation);
|
||||
@@ -109,7 +109,7 @@ public class ResolutionResultsCacheImpl implements ResolutionResultsCache {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResolvedCallWithTrace<?> getCallForArgument(@Nullable JetExpression expression) {
|
||||
public MutableResolvedCall<?> getCallForArgument(@Nullable JetExpression expression) {
|
||||
return getValueTryingAllCallTypes(expression, RESOLVED_CALL_FOR_ARGUMENT);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -22,7 +22,7 @@ import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.psi.CallKey;
|
||||
import org.jetbrains.jet.lang.psi.JetExpression;
|
||||
import org.jetbrains.jet.lang.resolve.DelegatingBindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsImpl;
|
||||
|
||||
public class TemporaryResolutionResultsCache implements ResolutionResultsCache {
|
||||
@@ -76,7 +76,7 @@ public class TemporaryResolutionResultsCache implements ResolutionResultsCache {
|
||||
@Override
|
||||
public <D extends CallableDescriptor> void recordDeferredComputationForCall(
|
||||
@NotNull CallKey callKey,
|
||||
@NotNull ResolvedCallWithTrace<D> resolvedCall,
|
||||
@NotNull MutableResolvedCall<D> resolvedCall,
|
||||
@NotNull CallCandidateResolutionContext<D> deferredComputation
|
||||
) {
|
||||
innerCache.recordDeferredComputationForCall(callKey, resolvedCall, deferredComputation);
|
||||
@@ -94,8 +94,8 @@ public class TemporaryResolutionResultsCache implements ResolutionResultsCache {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public ResolvedCallWithTrace<?> getCallForArgument(@Nullable JetExpression expression) {
|
||||
ResolvedCallWithTrace<?> resolvedCall = innerCache.getCallForArgument(expression);
|
||||
public MutableResolvedCall<?> getCallForArgument(@Nullable JetExpression expression) {
|
||||
MutableResolvedCall<?> resolvedCall = innerCache.getCallForArgument(expression);
|
||||
if (resolvedCall != null) {
|
||||
return resolvedCall;
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.DelegatingBindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.results.ResolutionStatus;
|
||||
|
||||
public interface ResolvedCallWithTrace<D extends CallableDescriptor> extends ResolvedCall<D> {
|
||||
public interface MutableResolvedCall<D extends CallableDescriptor> extends ResolvedCall<D> {
|
||||
|
||||
@NotNull
|
||||
ResolutionStatus getStatus();
|
||||
+5
-5
@@ -44,18 +44,18 @@ import java.util.*;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.results.ResolutionStatus.INCOMPLETE_TYPE_INFERENCE;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.results.ResolutionStatus.UNKNOWN_STATUS;
|
||||
|
||||
public class ResolvedCallImpl<D extends CallableDescriptor> implements ResolvedCallWithTrace<D> {
|
||||
public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableResolvedCall<D> {
|
||||
|
||||
public static final Function<ResolvedCallWithTrace<?>, CallableDescriptor> MAP_TO_CANDIDATE = new Function<ResolvedCallWithTrace<?>, CallableDescriptor>() {
|
||||
public static final Function<MutableResolvedCall<?>, CallableDescriptor> MAP_TO_CANDIDATE = new Function<MutableResolvedCall<?>, CallableDescriptor>() {
|
||||
@Override
|
||||
public CallableDescriptor fun(ResolvedCallWithTrace<?> resolvedCall) {
|
||||
public CallableDescriptor fun(MutableResolvedCall<?> resolvedCall) {
|
||||
return resolvedCall.getCandidateDescriptor();
|
||||
}
|
||||
};
|
||||
|
||||
public static final Function<ResolvedCallWithTrace<?>, CallableDescriptor> MAP_TO_RESULT = new Function<ResolvedCallWithTrace<?>, CallableDescriptor>() {
|
||||
public static final Function<MutableResolvedCall<?>, CallableDescriptor> MAP_TO_RESULT = new Function<MutableResolvedCall<?>, CallableDescriptor>() {
|
||||
@Override
|
||||
public CallableDescriptor fun(ResolvedCallWithTrace<?> resolvedCall) {
|
||||
public CallableDescriptor fun(MutableResolvedCall<?> resolvedCall) {
|
||||
return resolvedCall.getResultingDescriptor();
|
||||
}
|
||||
};
|
||||
|
||||
+7
-7
@@ -33,23 +33,23 @@ import org.jetbrains.jet.lang.types.JetType;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class VariableAsFunctionResolvedCall implements ResolvedCallWithTrace<FunctionDescriptor> {
|
||||
private final ResolvedCallWithTrace<FunctionDescriptor> functionCall;
|
||||
private final ResolvedCallWithTrace<VariableDescriptor> variableCall;
|
||||
public class VariableAsFunctionResolvedCall implements MutableResolvedCall<FunctionDescriptor> {
|
||||
private final MutableResolvedCall<FunctionDescriptor> functionCall;
|
||||
private final MutableResolvedCall<VariableDescriptor> variableCall;
|
||||
|
||||
public VariableAsFunctionResolvedCall(@NotNull ResolvedCallWithTrace<FunctionDescriptor> functionCall,
|
||||
@NotNull ResolvedCallWithTrace<VariableDescriptor> variableCall) {
|
||||
public VariableAsFunctionResolvedCall(@NotNull MutableResolvedCall<FunctionDescriptor> functionCall,
|
||||
@NotNull MutableResolvedCall<VariableDescriptor> variableCall) {
|
||||
this.functionCall = functionCall;
|
||||
this.variableCall = variableCall;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ResolvedCallWithTrace<FunctionDescriptor> getFunctionCall() {
|
||||
public MutableResolvedCall<FunctionDescriptor> getFunctionCall() {
|
||||
return functionCall;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ResolvedCallWithTrace<VariableDescriptor> getVariableCall() {
|
||||
public MutableResolvedCall<VariableDescriptor> getVariableCall() {
|
||||
return variableCall;
|
||||
}
|
||||
|
||||
|
||||
+13
-13
@@ -20,67 +20,67 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.DelegatingBindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class OverloadResolutionResultsImpl<D extends CallableDescriptor> implements OverloadResolutionResults<D> {
|
||||
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> success(@NotNull ResolvedCallWithTrace<D> candidate) {
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> success(@NotNull MutableResolvedCall<D> candidate) {
|
||||
return new OverloadResolutionResultsImpl<D>(Code.SUCCESS, Collections.singleton(candidate));
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> nameNotFound() {
|
||||
OverloadResolutionResultsImpl<D> results = new OverloadResolutionResultsImpl<D>(
|
||||
Code.NAME_NOT_FOUND, Collections.<ResolvedCallWithTrace<D>>emptyList());
|
||||
Code.NAME_NOT_FOUND, Collections.<MutableResolvedCall<D>>emptyList());
|
||||
results.setAllCandidates(Collections.<ResolvedCall<D>>emptyList());
|
||||
return results;
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> singleFailedCandidate(ResolvedCallWithTrace<D> candidate) {
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> singleFailedCandidate(MutableResolvedCall<D> candidate) {
|
||||
return new OverloadResolutionResultsImpl<D>(Code.SINGLE_CANDIDATE_ARGUMENT_MISMATCH, Collections.singleton(candidate));
|
||||
}
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> manyFailedCandidates(Collection<ResolvedCallWithTrace<D>> failedCandidates) {
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> manyFailedCandidates(Collection<MutableResolvedCall<D>> failedCandidates) {
|
||||
return new OverloadResolutionResultsImpl<D>(Code.MANY_FAILED_CANDIDATES, failedCandidates);
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> candidatesWithWrongReceiver(Collection<ResolvedCallWithTrace<D>> failedCandidates) {
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> candidatesWithWrongReceiver(Collection<MutableResolvedCall<D>> failedCandidates) {
|
||||
return new OverloadResolutionResultsImpl<D>(Code.CANDIDATES_WITH_WRONG_RECEIVER, failedCandidates);
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> ambiguity(Collection<ResolvedCallWithTrace<D>> candidates) {
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> ambiguity(Collection<MutableResolvedCall<D>> candidates) {
|
||||
return new OverloadResolutionResultsImpl<D>(Code.AMBIGUITY, candidates);
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> incompleteTypeInference(Collection<ResolvedCallWithTrace<D>> candidates) {
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> incompleteTypeInference(Collection<MutableResolvedCall<D>> candidates) {
|
||||
return new OverloadResolutionResultsImpl<D>(Code.INCOMPLETE_TYPE_INFERENCE, candidates);
|
||||
}
|
||||
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> incompleteTypeInference(ResolvedCallWithTrace<D> candidate) {
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> incompleteTypeInference(MutableResolvedCall<D> candidate) {
|
||||
return incompleteTypeInference(Collections.singleton(candidate));
|
||||
}
|
||||
|
||||
private final Collection<ResolvedCallWithTrace<D>> results;
|
||||
private final Collection<MutableResolvedCall<D>> results;
|
||||
private final Code resultCode;
|
||||
private DelegatingBindingTrace trace;
|
||||
private Collection<ResolvedCall<D>> allCandidates;
|
||||
|
||||
private OverloadResolutionResultsImpl(@NotNull Code resultCode, @NotNull Collection<ResolvedCallWithTrace<D>> results) {
|
||||
private OverloadResolutionResultsImpl(@NotNull Code resultCode, @NotNull Collection<MutableResolvedCall<D>> results) {
|
||||
this.results = results;
|
||||
this.resultCode = resultCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public Collection<ResolvedCallWithTrace<D>> getResultingCalls() {
|
||||
public Collection<MutableResolvedCall<D>> getResultingCalls() {
|
||||
return results;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NotNull
|
||||
public ResolvedCallWithTrace<D> getResultingCall() {
|
||||
public MutableResolvedCall<D> getResultingCall() {
|
||||
assert isSingleResult();
|
||||
return results.iterator().next();
|
||||
}
|
||||
|
||||
+5
-6
@@ -20,10 +20,9 @@ import com.google.common.collect.Lists;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.calls.CallResolverUtil;
|
||||
import org.jetbrains.jet.lang.resolve.calls.context.ContextDependency;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
|
||||
import java.util.Collection;
|
||||
@@ -31,9 +30,9 @@ import java.util.Collection;
|
||||
public class OverloadResolutionResultsUtil {
|
||||
@NotNull
|
||||
public static <D extends CallableDescriptor> OverloadResolutionResults<D> ambiguity(OverloadResolutionResults<D> results1, OverloadResolutionResults<D> results2) {
|
||||
Collection<ResolvedCallWithTrace<D>> resultingCalls = Lists.newArrayList();
|
||||
resultingCalls.addAll((Collection<ResolvedCallWithTrace<D>>) results1.getResultingCalls());
|
||||
resultingCalls.addAll((Collection<ResolvedCallWithTrace<D>>) results2.getResultingCalls());
|
||||
Collection<MutableResolvedCall<D>> resultingCalls = Lists.newArrayList();
|
||||
resultingCalls.addAll((Collection<MutableResolvedCall<D>>) results1.getResultingCalls());
|
||||
resultingCalls.addAll((Collection<MutableResolvedCall<D>>) results2.getResultingCalls());
|
||||
return OverloadResolutionResultsImpl.ambiguity(resultingCalls);
|
||||
}
|
||||
|
||||
@@ -53,7 +52,7 @@ public class OverloadResolutionResultsUtil {
|
||||
) {
|
||||
if (results.isSingleResult() && contextDependency == ContextDependency.INDEPENDENT) {
|
||||
ResolvedCall<D> resultingCall = results.getResultingCall();
|
||||
if (!((ResolvedCallWithTrace<D>)resultingCall).getCallToCompleteTypeArgumentInference().hasInferredReturnType()) {
|
||||
if (!((MutableResolvedCall<D>)resultingCall).getCallToCompleteTypeArgumentInference().hasInferredReturnType()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-11
@@ -23,7 +23,7 @@ import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.resolve.DescriptorUtils;
|
||||
import org.jetbrains.jet.lang.resolve.OverrideResolver;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.TypeUtils;
|
||||
@@ -40,23 +40,23 @@ public class OverloadingConflictResolver {
|
||||
private OverloadingConflictResolver() {}
|
||||
|
||||
@Nullable
|
||||
public <D extends CallableDescriptor> ResolvedCallWithTrace<D> findMaximallySpecific(
|
||||
@NotNull Set<ResolvedCallWithTrace<D>> candidates,
|
||||
public <D extends CallableDescriptor> MutableResolvedCall<D> findMaximallySpecific(
|
||||
@NotNull Set<MutableResolvedCall<D>> candidates,
|
||||
boolean discriminateGenericDescriptors
|
||||
) {
|
||||
// Different autocasts may lead to the same candidate descriptor wrapped into different ResolvedCallImpl objects
|
||||
Set<ResolvedCallWithTrace<D>> maximallySpecific = new THashSet<ResolvedCallWithTrace<D>>(new TObjectHashingStrategy<ResolvedCallWithTrace<D>>() {
|
||||
Set<MutableResolvedCall<D>> maximallySpecific = new THashSet<MutableResolvedCall<D>>(new TObjectHashingStrategy<MutableResolvedCall<D>>() {
|
||||
@Override
|
||||
public boolean equals(ResolvedCallWithTrace<D> o1, ResolvedCallWithTrace<D> o2) {
|
||||
public boolean equals(MutableResolvedCall<D> o1, MutableResolvedCall<D> o2) {
|
||||
return o1 == null ? o2 == null : o1.getResultingDescriptor().equals(o2.getResultingDescriptor());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int computeHashCode(ResolvedCallWithTrace<D> object) {
|
||||
public int computeHashCode(MutableResolvedCall<D> object) {
|
||||
return object == null ? 0 : object.getResultingDescriptor().hashCode();
|
||||
}
|
||||
});
|
||||
for (ResolvedCallWithTrace<D> candidateCall : candidates) {
|
||||
for (MutableResolvedCall<D> candidateCall : candidates) {
|
||||
if (isMaximallySpecific(candidateCall, candidates, discriminateGenericDescriptors)) {
|
||||
maximallySpecific.add(candidateCall);
|
||||
}
|
||||
@@ -65,8 +65,8 @@ public class OverloadingConflictResolver {
|
||||
}
|
||||
|
||||
private <D extends CallableDescriptor> boolean isMaximallySpecific(
|
||||
@NotNull ResolvedCallWithTrace<D> candidateCall,
|
||||
@NotNull Set<ResolvedCallWithTrace<D>> candidates,
|
||||
@NotNull MutableResolvedCall<D> candidateCall,
|
||||
@NotNull Set<MutableResolvedCall<D>> candidates,
|
||||
boolean discriminateGenericDescriptors
|
||||
) {
|
||||
D me = candidateCall.getResultingDescriptor();
|
||||
@@ -80,7 +80,7 @@ public class OverloadingConflictResolver {
|
||||
variable = null;
|
||||
}
|
||||
|
||||
for (ResolvedCallWithTrace<D> otherCall : candidates) {
|
||||
for (MutableResolvedCall<D> otherCall : candidates) {
|
||||
D other = otherCall.getResultingDescriptor();
|
||||
if (other == me) continue;
|
||||
|
||||
@@ -89,7 +89,7 @@ public class OverloadingConflictResolver {
|
||||
if (!isInvoke) return false;
|
||||
|
||||
assert otherCall instanceof VariableAsFunctionResolvedCall : "'invoke' candidate goes with usual one: " + candidateCall + otherCall;
|
||||
ResolvedCallWithTrace<VariableDescriptor> otherVariableCall = ((VariableAsFunctionResolvedCall) otherCall).getVariableCall();
|
||||
MutableResolvedCall<VariableDescriptor> otherVariableCall = ((VariableAsFunctionResolvedCall) otherCall).getVariableCall();
|
||||
if (definitelyNotMaximallySpecific(variable, otherVariableCall.getResultingDescriptor(), discriminateGenericDescriptors)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
+27
-27
@@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||
import org.jetbrains.jet.lang.resolve.OverrideResolver;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.tasks.TracingStrategy;
|
||||
|
||||
import java.util.*;
|
||||
@@ -39,13 +39,13 @@ public class ResolutionResultsHandler {
|
||||
public <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> computeResultAndReportErrors(
|
||||
@NotNull BindingTrace trace,
|
||||
@NotNull TracingStrategy tracing,
|
||||
@NotNull Collection<ResolvedCallWithTrace<D>> candidates
|
||||
@NotNull Collection<MutableResolvedCall<D>> candidates
|
||||
) {
|
||||
Set<ResolvedCallWithTrace<D>> successfulCandidates = Sets.newLinkedHashSet();
|
||||
Set<ResolvedCallWithTrace<D>> failedCandidates = Sets.newLinkedHashSet();
|
||||
Set<ResolvedCallWithTrace<D>> incompleteCandidates = Sets.newLinkedHashSet();
|
||||
Set<ResolvedCallWithTrace<D>> candidatesWithWrongReceiver = Sets.newLinkedHashSet();
|
||||
for (ResolvedCallWithTrace<D> candidateCall : candidates) {
|
||||
Set<MutableResolvedCall<D>> successfulCandidates = Sets.newLinkedHashSet();
|
||||
Set<MutableResolvedCall<D>> failedCandidates = Sets.newLinkedHashSet();
|
||||
Set<MutableResolvedCall<D>> incompleteCandidates = Sets.newLinkedHashSet();
|
||||
Set<MutableResolvedCall<D>> candidatesWithWrongReceiver = Sets.newLinkedHashSet();
|
||||
for (MutableResolvedCall<D> candidateCall : candidates) {
|
||||
ResolutionStatus status = candidateCall.getStatus();
|
||||
assert status != UNKNOWN_STATUS : "No resolution for " + candidateCall.getCandidateDescriptor();
|
||||
if (status.isSuccess()) {
|
||||
@@ -81,15 +81,15 @@ public class ResolutionResultsHandler {
|
||||
private <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> computeSuccessfulResult(
|
||||
BindingTrace trace,
|
||||
TracingStrategy tracing,
|
||||
Set<ResolvedCallWithTrace<D>> successfulCandidates,
|
||||
Set<ResolvedCallWithTrace<D>> incompleteCandidates
|
||||
Set<MutableResolvedCall<D>> successfulCandidates,
|
||||
Set<MutableResolvedCall<D>> incompleteCandidates
|
||||
) {
|
||||
Set<ResolvedCallWithTrace<D>> successfulAndIncomplete = Sets.newLinkedHashSet();
|
||||
Set<MutableResolvedCall<D>> successfulAndIncomplete = Sets.newLinkedHashSet();
|
||||
successfulAndIncomplete.addAll(successfulCandidates);
|
||||
successfulAndIncomplete.addAll(incompleteCandidates);
|
||||
OverloadResolutionResultsImpl<D> results = chooseAndReportMaximallySpecific(successfulAndIncomplete, true);
|
||||
if (results.isSingleResult()) {
|
||||
ResolvedCallWithTrace<D> resultingCall = results.getResultingCall();
|
||||
MutableResolvedCall<D> resultingCall = results.getResultingCall();
|
||||
resultingCall.getTrace().moveAllMyDataTo(trace);
|
||||
if (resultingCall.getStatus() == INCOMPLETE_TYPE_INFERENCE) {
|
||||
return OverloadResolutionResultsImpl.incompleteTypeInference(resultingCall);
|
||||
@@ -114,15 +114,15 @@ public class ResolutionResultsHandler {
|
||||
private <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> computeFailedResult(
|
||||
BindingTrace trace,
|
||||
TracingStrategy tracing,
|
||||
Set<ResolvedCallWithTrace<D>> failedCandidates
|
||||
Set<MutableResolvedCall<D>> failedCandidates
|
||||
) {
|
||||
if (failedCandidates.size() != 1) {
|
||||
// This is needed when there are several overloads some of which are OK but for nullability of the receiver,
|
||||
// and some are not OK at all. In this case we'd like to say "unsafe call" rather than "none applicable"
|
||||
// Used to be: weak errors. Generalized for future extensions
|
||||
for (EnumSet<ResolutionStatus> severityLevel : SEVERITY_LEVELS) {
|
||||
Set<ResolvedCallWithTrace<D>> thisLevel = Sets.newLinkedHashSet();
|
||||
for (ResolvedCallWithTrace<D> candidate : failedCandidates) {
|
||||
Set<MutableResolvedCall<D>> thisLevel = Sets.newLinkedHashSet();
|
||||
for (MutableResolvedCall<D> candidate : failedCandidates) {
|
||||
if (severityLevel.contains(candidate.getStatus())) {
|
||||
thisLevel.add(candidate);
|
||||
}
|
||||
@@ -142,7 +142,7 @@ public class ResolutionResultsHandler {
|
||||
|
||||
assert false : "Should not be reachable, cause every status must belong to some level";
|
||||
|
||||
Set<ResolvedCallWithTrace<D>> noOverrides = OverrideResolver.filterOutOverridden(failedCandidates, MAP_TO_CANDIDATE);
|
||||
Set<MutableResolvedCall<D>> noOverrides = OverrideResolver.filterOutOverridden(failedCandidates, MAP_TO_CANDIDATE);
|
||||
if (noOverrides.size() != 1) {
|
||||
tracing.noneApplicable(trace, noOverrides);
|
||||
tracing.recordAmbiguity(trace, noOverrides);
|
||||
@@ -152,20 +152,20 @@ public class ResolutionResultsHandler {
|
||||
failedCandidates = noOverrides;
|
||||
}
|
||||
|
||||
ResolvedCallWithTrace<D> failed = failedCandidates.iterator().next();
|
||||
MutableResolvedCall<D> failed = failedCandidates.iterator().next();
|
||||
failed.getTrace().moveAllMyDataTo(trace);
|
||||
return OverloadResolutionResultsImpl.singleFailedCandidate(failed);
|
||||
}
|
||||
|
||||
private static <D extends CallableDescriptor> boolean allClean(@NotNull Collection<ResolvedCallWithTrace<D>> results) {
|
||||
for (ResolvedCallWithTrace<D> result : results) {
|
||||
private static <D extends CallableDescriptor> boolean allClean(@NotNull Collection<MutableResolvedCall<D>> results) {
|
||||
for (MutableResolvedCall<D> result : results) {
|
||||
if (result.isDirty()) return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
private static <D extends CallableDescriptor> boolean allIncomplete(@NotNull Collection<ResolvedCallWithTrace<D>> results) {
|
||||
for (ResolvedCallWithTrace<D> result : results) {
|
||||
private static <D extends CallableDescriptor> boolean allIncomplete(@NotNull Collection<MutableResolvedCall<D>> results) {
|
||||
for (MutableResolvedCall<D> result : results) {
|
||||
if (result.getStatus() != INCOMPLETE_TYPE_INFERENCE) return false;
|
||||
}
|
||||
return true;
|
||||
@@ -173,16 +173,16 @@ public class ResolutionResultsHandler {
|
||||
|
||||
@NotNull
|
||||
private <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> chooseAndReportMaximallySpecific(
|
||||
@NotNull Set<ResolvedCallWithTrace<D>> candidates,
|
||||
@NotNull Set<MutableResolvedCall<D>> candidates,
|
||||
boolean discriminateGenerics
|
||||
) {
|
||||
if (candidates.size() == 1) {
|
||||
return OverloadResolutionResultsImpl.success(candidates.iterator().next());
|
||||
}
|
||||
|
||||
Set<ResolvedCallWithTrace<D>> cleanCandidates = Sets.newLinkedHashSet(candidates);
|
||||
for (Iterator<ResolvedCallWithTrace<D>> iterator = cleanCandidates.iterator(); iterator.hasNext(); ) {
|
||||
ResolvedCallWithTrace<D> candidate = iterator.next();
|
||||
Set<MutableResolvedCall<D>> cleanCandidates = Sets.newLinkedHashSet(candidates);
|
||||
for (Iterator<MutableResolvedCall<D>> iterator = cleanCandidates.iterator(); iterator.hasNext(); ) {
|
||||
MutableResolvedCall<D> candidate = iterator.next();
|
||||
if (candidate.isDirty()) {
|
||||
iterator.remove();
|
||||
}
|
||||
@@ -191,19 +191,19 @@ public class ResolutionResultsHandler {
|
||||
if (cleanCandidates.isEmpty()) {
|
||||
cleanCandidates = candidates;
|
||||
}
|
||||
ResolvedCallWithTrace<D> maximallySpecific = OverloadingConflictResolver.INSTANCE.findMaximallySpecific(cleanCandidates, false);
|
||||
MutableResolvedCall<D> maximallySpecific = OverloadingConflictResolver.INSTANCE.findMaximallySpecific(cleanCandidates, false);
|
||||
if (maximallySpecific != null) {
|
||||
return OverloadResolutionResultsImpl.success(maximallySpecific);
|
||||
}
|
||||
|
||||
if (discriminateGenerics) {
|
||||
ResolvedCallWithTrace<D> maximallySpecificGenericsDiscriminated = OverloadingConflictResolver.INSTANCE.findMaximallySpecific(cleanCandidates, true);
|
||||
MutableResolvedCall<D> maximallySpecificGenericsDiscriminated = OverloadingConflictResolver.INSTANCE.findMaximallySpecific(cleanCandidates, true);
|
||||
if (maximallySpecificGenericsDiscriminated != null) {
|
||||
return OverloadResolutionResultsImpl.success(maximallySpecificGenericsDiscriminated);
|
||||
}
|
||||
}
|
||||
|
||||
Set<ResolvedCallWithTrace<D>> noOverrides = OverrideResolver.filterOutOverridden(candidates, MAP_TO_RESULT);
|
||||
Set<MutableResolvedCall<D>> noOverrides = OverrideResolver.filterOutOverridden(candidates, MAP_TO_RESULT);
|
||||
if (noOverrides.size() == 1) {
|
||||
return OverloadResolutionResultsImpl.success(noOverrides.iterator().next());
|
||||
}
|
||||
|
||||
+6
-6
@@ -27,7 +27,7 @@ import org.jetbrains.jet.lang.resolve.calls.CallResolverExtension;
|
||||
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
||||
import org.jetbrains.jet.lang.resolve.calls.context.*;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableDataFlowInfoForArguments;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||
import org.jetbrains.jet.lang.types.JetType;
|
||||
import org.jetbrains.jet.lang.types.expressions.LabelResolver;
|
||||
@@ -39,7 +39,7 @@ import java.util.Collection;
|
||||
*/
|
||||
public class ResolutionTask<D extends CallableDescriptor, F extends D> extends CallResolutionContext<ResolutionTask<D, F>> {
|
||||
private final Collection<ResolutionCandidate<D>> candidates;
|
||||
private final Collection<ResolvedCallWithTrace<F>> resolvedCalls;
|
||||
private final Collection<MutableResolvedCall<F>> resolvedCalls;
|
||||
private DescriptorCheckStrategy checkingStrategy;
|
||||
public final TracingStrategy tracing;
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ResolutionTask<D extends CallableDescriptor, F extends D> extends C
|
||||
@NotNull LabelResolver labelResolver,
|
||||
@Nullable MutableDataFlowInfoForArguments dataFlowInfoForArguments,
|
||||
@NotNull CallResolverExtension callResolverExtension,
|
||||
@NotNull Collection<ResolvedCallWithTrace<F>> resolvedCalls,
|
||||
@NotNull Collection<MutableResolvedCall<F>> resolvedCalls,
|
||||
boolean isAnnotationContext,
|
||||
boolean collectAllCandidates
|
||||
) {
|
||||
@@ -77,7 +77,7 @@ public class ResolutionTask<D extends CallableDescriptor, F extends D> extends C
|
||||
context.trace, context.scope, context.call,
|
||||
context.expectedType, context.dataFlowInfo, context.contextDependency, context.checkArguments,
|
||||
context.resolutionResultsCache, context.labelResolver, context.dataFlowInfoForArguments,
|
||||
context.callResolverExtension, Lists.<ResolvedCallWithTrace<F>>newArrayList(), context.isAnnotationContext, context.collectAllCandidates);
|
||||
context.callResolverExtension, Lists.<MutableResolvedCall<F>>newArrayList(), context.isAnnotationContext, context.collectAllCandidates);
|
||||
}
|
||||
|
||||
public ResolutionTask(
|
||||
@@ -93,12 +93,12 @@ public class ResolutionTask<D extends CallableDescriptor, F extends D> extends C
|
||||
return candidates;
|
||||
}
|
||||
|
||||
public void addResolvedCall(@NotNull ResolvedCallWithTrace<F> resolvedCall) {
|
||||
public void addResolvedCall(@NotNull MutableResolvedCall<F> resolvedCall) {
|
||||
resolvedCalls.add(resolvedCall);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public Collection<ResolvedCallWithTrace<F>> getResolvedCalls() {
|
||||
public Collection<MutableResolvedCall<F>> getResolvedCalls() {
|
||||
return resolvedCalls;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,8 +28,8 @@ import org.jetbrains.jet.lang.psi.JetElement;
|
||||
import org.jetbrains.jet.lang.psi.JetFile;
|
||||
import org.jetbrains.jet.lang.resolve.AnalyzingUtils;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace;
|
||||
import org.jetbrains.jet.lang.resolve.java.AnalyzerFacadeForJVM;
|
||||
|
||||
import java.io.File;
|
||||
@@ -79,7 +79,7 @@ public abstract class AbstractJetDiagnosticsTest extends BaseDiagnosticsTest {
|
||||
DiagnosticUtils.getLineAndColumnInPsiFile(element.getContainingFile(), element.getTextRange());
|
||||
|
||||
assertTrue("Resolved call for '" + element.getText() + "'" + lineAndColumn + " in not completed",
|
||||
((ResolvedCallWithTrace<?>) resolvedCall).isCompleted());
|
||||
((MutableResolvedCall<?>) resolvedCall).isCompleted());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user