extracted method commitResolutionCacheData
commit resolve data after argument analysis with temporary trace
This commit is contained in:
@@ -25,6 +25,7 @@ import org.jetbrains.jet.lang.descriptors.*;
|
|||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.util.slicedmap.ReadOnlySlice;
|
import org.jetbrains.jet.util.slicedmap.ReadOnlySlice;
|
||||||
import org.jetbrains.jet.util.slicedmap.Slices;
|
import org.jetbrains.jet.util.slicedmap.Slices;
|
||||||
|
import org.jetbrains.jet.util.slicedmap.WritableSlice;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
@@ -265,4 +266,15 @@ public class BindingContextUtils {
|
|||||||
}
|
}
|
||||||
trace.report(AMBIGUOUS_LABEL.on(targetLabel));
|
trace.report(AMBIGUOUS_LABEL.on(targetLabel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void commitResolutionCacheData(@NotNull DelegatingBindingTrace trace, @NotNull BindingTrace traceForResolutionCache) {
|
||||||
|
trace.addAllMyDataTo(traceForResolutionCache, new TraceEntryFilter() {
|
||||||
|
@Override
|
||||||
|
public boolean accept(@NotNull WritableSlice<?, ?> slice, Object key) {
|
||||||
|
return slice == BindingContext.RESOLUTION_RESULTS_FOR_FUNCTION ||
|
||||||
|
slice == BindingContext.RESOLUTION_RESULTS_FOR_PROPERTY ||
|
||||||
|
slice == BindingContext.TRACE_DELTAS_CACHE;
|
||||||
|
}
|
||||||
|
}, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -516,13 +516,7 @@ public class CallResolver {
|
|||||||
task.getResolvedCalls().add(call);
|
task.getResolvedCalls().add(call);
|
||||||
}
|
}
|
||||||
|
|
||||||
context.candidateCall.getTrace().addAllMyDataTo(traceForResolutionCache, new TraceEntryFilter() {
|
BindingContextUtils.commitResolutionCacheData(context.candidateCall.getTrace(), traceForResolutionCache);
|
||||||
@Override
|
|
||||||
public boolean accept(@NotNull WritableSlice<?, ?> slice, Object key) {
|
|
||||||
return slice == BindingContext.RESOLUTION_RESULTS_FOR_FUNCTION || slice == BindingContext.RESOLUTION_RESULTS_FOR_PROPERTY ||
|
|
||||||
slice == BindingContext.TRACE_DELTAS_CACHE;
|
|
||||||
}
|
|
||||||
}, false);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -366,6 +366,7 @@ public class CandidateResolver {
|
|||||||
expectedType != null ? expectedType : NO_EXPECTED_TYPE, resolveFunctionArgumentBodies).getType();
|
expectedType != null ? expectedType : NO_EXPECTED_TYPE, resolveFunctionArgumentBodies).getType();
|
||||||
constraintSystem.addSubtypeConstraint(type, effectiveExpectedType, ConstraintPosition.getValueParameterPosition(
|
constraintSystem.addSubtypeConstraint(type, effectiveExpectedType, ConstraintPosition.getValueParameterPosition(
|
||||||
valueParameterDescriptor.getIndex()));
|
valueParameterDescriptor.getIndex()));
|
||||||
|
BindingContextUtils.commitResolutionCacheData(traceForUnknown, context.trace);
|
||||||
if (isErrorType != null) {
|
if (isErrorType != null) {
|
||||||
isErrorType[0] = type == null || ErrorUtils.isErrorType(type);
|
isErrorType[0] = type == null || ErrorUtils.isErrorType(type);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user