diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/BasicResolutionContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/BasicResolutionContext.java index bf362d26793..981b010a52d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/BasicResolutionContext.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/BasicResolutionContext.java @@ -35,4 +35,9 @@ public class BasicResolutionContext extends ResolutionContext { private BasicResolutionContext(BindingTrace trace, JetScope scope, Call call, JetType expectedType, DataFlowInfo dataFlowInfo) { super(trace, scope, call, expectedType, dataFlowInfo); } + + @NotNull + public BasicResolutionContext replaceTrace(@NotNull BindingTrace trace) { + return create(trace, scope, call, expectedType, dataFlowInfo); + } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformer.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformer.java index 82322071360..ee12572018f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformer.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformer.java @@ -57,10 +57,10 @@ public class CallTransformer { @NotNull public Collection> createCallContexts(@NotNull ResolutionCandidate candidate, @NotNull ResolutionTask task, - @NotNull TemporaryBindingTrace temporaryTrace) { + @NotNull TemporaryBindingTrace candidateTrace) { - ResolvedCallImpl candidateCall = ResolvedCallImpl.create(candidate, temporaryTrace); - return Collections.singleton(CallResolutionContext.create(candidateCall, task, temporaryTrace, task.tracing)); + ResolvedCallImpl candidateCall = ResolvedCallImpl.create(candidate, candidateTrace); + return Collections.singleton(CallResolutionContext.create(candidateCall, task, candidateTrace, task.tracing)); } /** @@ -82,10 +82,10 @@ public class CallTransformer { @NotNull @Override public Collection> createCallContexts(@NotNull ResolutionCandidate candidate, - @NotNull ResolutionTask task, @NotNull TemporaryBindingTrace temporaryTrace) { + @NotNull ResolutionTask task, @NotNull TemporaryBindingTrace candidateTrace) { if (candidate.getDescriptor() instanceof FunctionDescriptor) { - return super.createCallContexts(candidate, task, temporaryTrace); + return super.createCallContexts(candidate, task, candidateTrace); } assert candidate.getDescriptor() instanceof VariableDescriptor; @@ -94,18 +94,18 @@ public class CallTransformer { Call variableCall = stripCallArguments(task); if (!hasReceiver) { CallResolutionContext context = CallResolutionContext.create( - ResolvedCallImpl.create(candidate, temporaryTrace), task, temporaryTrace, task.tracing, variableCall); + ResolvedCallImpl.create(candidate, candidateTrace), task, candidateTrace, task.tracing, variableCall); return Collections.singleton(context); } Call variableCallWithoutReceiver = stripReceiver(variableCall); CallResolutionContext contextWithReceiver = createContextWithChainedTrace( - candidate, variableCall, temporaryTrace, task); + candidate, variableCall, candidateTrace, task); ResolutionCandidate candidateWithoutReceiver = ResolutionCandidate.create( candidate.getDescriptor(), candidate.getThisObject(), ReceiverDescriptor.NO_RECEIVER, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, false); CallResolutionContext contextWithoutReceiver = createContextWithChainedTrace( - candidateWithoutReceiver, variableCallWithoutReceiver, temporaryTrace, task); + candidateWithoutReceiver, variableCallWithoutReceiver, candidateTrace, task); contextWithoutReceiver.receiverForVariableAsFunctionSecondCall = variableCall.getExplicitReceiver(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.java index 7dca99f24de..0fbf0d384b0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/scopes/receivers/ClassReceiver.java @@ -45,7 +45,7 @@ public class ClassReceiver implements ThisReceiverDescriptor { @NotNull @Override - public DeclarationDescriptor getDeclarationDescriptor() { + public ClassDescriptor getDeclarationDescriptor() { return classDescriptor; }