Fixed bug: resolution task wasn't recreated

The old resolved calls were used
This commit is contained in:
Svetlana Isakova
2014-04-28 08:56:53 +04:00
parent a57b4f6459
commit 808cf75060
3 changed files with 17 additions and 1 deletions
@@ -564,7 +564,8 @@ public class CallResolver {
};
TemporaryBindingTrace temporaryTrace =
TemporaryBindingTrace.create(task.trace, "trace for resolution guarded for extra function literal arguments");
ResolutionTask<D, F> newTask = task.replaceBindingTrace(temporaryTrace).replaceCall(callWithoutFLArgs);
ResolutionTask<D, F> newTask = new ResolutionTask<D, F>(task.getCandidates(), task.toBasic(), task.tracing).
replaceBindingTrace(temporaryTrace).replaceCall(callWithoutFLArgs);
OverloadResolutionResultsImpl<F> resultsWithFunctionLiteralsStripped = performResolution(newTask, callTransformer);
if (resultsWithFunctionLiteralsStripped.isSuccess() || resultsWithFunctionLiteralsStripped.isAmbiguity()) {
@@ -0,0 +1,10 @@
package p
class X<V>(provider: () -> V, trackValue: Boolean) {
}
class B {
val c = <!NO_VALUE_FOR_PARAMETER!>X<!><String> <!TYPE_MISMATCH!>{
"e"
}<!>
}
@@ -6131,6 +6131,11 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/diagnostics/tests/resolve"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("incompleteConstructorInvocation.kt")
public void testIncompleteConstructorInvocation() throws Exception {
doTest("compiler/testData/diagnostics/tests/resolve/incompleteConstructorInvocation.kt");
}
@TestMetadata("resolveWithFunctionLiteralWithId.kt")
public void testResolveWithFunctionLiteralWithId() throws Exception {
doTest("compiler/testData/diagnostics/tests/resolve/resolveWithFunctionLiteralWithId.kt");