store unsubstituted descriptor as REFERENCE_TARGET

This commit is contained in:
Svetlana Isakova
2014-01-14 15:50:17 +04:00
parent 8868da8c5f
commit 64e13114e2
7 changed files with 33 additions and 4 deletions
@@ -521,10 +521,10 @@ public class CandidateResolver {
if (!(callElement instanceof JetCallExpression)) return;
JetCallExpression callExpression = (JetCallExpression) callElement;
CallableDescriptor resultingDescriptor = context.candidateCall.getResultingDescriptor();
if (BindingContextUtils.isCallExpressionWithValidReference(callExpression, context.trace.getBindingContext())) {
CallableDescriptor resultingDescriptor = context.candidateCall.getResultingDescriptor();
context.trace.record(BindingContext.EXPRESSION_TYPE, callExpression, resultingDescriptor.getReturnType());
context.trace.record(BindingContext.REFERENCE_TARGET, callExpression, resultingDescriptor);
context.trace.record(BindingContext.REFERENCE_TARGET, callExpression, context.candidateCall.getCandidateDescriptor());
}
}
@@ -59,9 +59,9 @@ public class TracingStrategyImpl implements TracingStrategy {
@Override
public <D extends CallableDescriptor> void bindReference(@NotNull BindingTrace trace, @NotNull ResolvedCallWithTrace<D> resolvedCall) {
CallableDescriptor descriptor = resolvedCall.getResultingDescriptor();
CallableDescriptor descriptor = resolvedCall.getCandidateDescriptor();
if (resolvedCall instanceof VariableAsFunctionResolvedCall) {
descriptor = ((VariableAsFunctionResolvedCall) resolvedCall).getVariableCall().getResultingDescriptor();
descriptor = ((VariableAsFunctionResolvedCall) resolvedCall).getVariableCall().getCandidateDescriptor();
}
DeclarationDescriptor storedReference = trace.get(REFERENCE_TARGET, reference);
if (storedReference == null || !ErrorUtils.isError(descriptor)) {