diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java index 6d96098ced6..ef0e8b5db76 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java @@ -277,6 +277,11 @@ public class CallResolver { delegatingBindingTrace.addAllMyDataTo(cloneDelta); cacheResults(resolutionResultsSlice, context, results, cloneDelta); + if (prioritizedTasks.isEmpty()) { + delegatingBindingTrace.commit(); + return results; + } + TemporaryBindingTrace temporaryBindingTrace = null; if (results instanceof OverloadResolutionResultsImpl) { temporaryBindingTrace = ((OverloadResolutionResultsImpl) results).getTrace(); @@ -284,7 +289,7 @@ public class CallResolver { newContext = newContext.replaceTrace(temporaryBindingTrace); } } - TracingStrategy tracing = !prioritizedTasks.isEmpty() ? prioritizedTasks.iterator().next().tracing : null; + TracingStrategy tracing = prioritizedTasks.iterator().next().tracing; OverloadResolutionResults completeResults = completeTypeInferenceDependentOnExpectedType(newContext, results, tracing); if (temporaryBindingTrace != null) { temporaryBindingTrace.commit(); @@ -296,7 +301,8 @@ public class CallResolver { private OverloadResolutionResults completeTypeInferenceDependentOnExpectedType( @NotNull BasicResolutionContext context, @NotNull OverloadResolutionResults results, - @Nullable TracingStrategy tracing) { + @NotNull TracingStrategy tracing + ) { if (results.getResultCode() != OverloadResolutionResults.Code.INCOMPLETE_TYPE_INFERENCE) return results; Set> successful = Sets.newLinkedHashSet(); Set> failed = Sets.newLinkedHashSet();