'CANNOT_COMPLETE_RESOLVE' error added

This commit is contained in:
Svetlana Isakova
2012-11-09 15:37:10 +04:00
parent eb5b551114
commit dda3091dfb
6 changed files with 29 additions and 0 deletions
@@ -325,6 +325,7 @@ public interface Errors {
AmbiguousDescriptorDiagnosticFactory OVERLOAD_RESOLUTION_AMBIGUITY = new AmbiguousDescriptorDiagnosticFactory();
AmbiguousDescriptorDiagnosticFactory NONE_APPLICABLE = new AmbiguousDescriptorDiagnosticFactory();
AmbiguousDescriptorDiagnosticFactory CANNOT_COMPLETE_RESOLVE = new AmbiguousDescriptorDiagnosticFactory();
SimpleDiagnosticFactory<JetExpression> DANGLING_FUNCTION_LITERAL_ARGUMENT_SUSPECTED = SimpleDiagnosticFactory.create(WARNING);
@@ -400,6 +400,8 @@ public class DefaultErrorMessages {
MAP.put(OVERLOAD_RESOLUTION_AMBIGUITY, "Overload resolution ambiguity: {0}", AMBIGUOUS_CALLS);
MAP.put(NONE_APPLICABLE, "None of the following functions can be called with the arguments supplied: {0}", AMBIGUOUS_CALLS);
MAP.put(CANNOT_COMPLETE_RESOLVE, "Cannot choose among the following candidates without completing type inference: {0}", AMBIGUOUS_CALLS);
MAP.put(NO_VALUE_FOR_PARAMETER, "No value passed for parameter {0}", NAME);
MAP.put(MISSING_RECEIVER, "A receiver of type {0} is required", RENDER_TYPE);
MAP.put(NO_RECEIVER_ADMITTED, "No receiver can be passed to this function or property");
@@ -190,6 +190,14 @@ public class ResolutionTask<D extends CallableDescriptor, F extends D> extends R
trace.report(NONE_APPLICABLE.on(reference, descriptors));
}
@Override
public <D extends CallableDescriptor> void cannotCompleteResolve(
@NotNull BindingTrace trace,
@NotNull Collection<ResolvedCallWithTrace<D>> descriptors
) {
trace.report(CANNOT_COMPLETE_RESOLVE.on(reference, descriptors));
}
@Override
public void instantiationOfAbstractClass(@NotNull BindingTrace trace) {
trace.report(CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS.on(call.getCallElement()));
@@ -73,6 +73,12 @@ public interface TracingStrategy {
@Override
public <D extends CallableDescriptor> void noneApplicable(@NotNull BindingTrace trace, @NotNull Collection<ResolvedCallWithTrace<D>> descriptors) {}
@Override
public <D extends CallableDescriptor> void cannotCompleteResolve(
@NotNull BindingTrace trace,
@NotNull Collection<ResolvedCallWithTrace<D>> descriptors
) {}
@Override
public void instantiationOfAbstractClass(@NotNull BindingTrace trace) {}
@@ -118,6 +124,11 @@ public interface TracingStrategy {
<D extends CallableDescriptor> void noneApplicable(@NotNull BindingTrace trace, @NotNull Collection<ResolvedCallWithTrace<D>> descriptors);
<D extends CallableDescriptor> void cannotCompleteResolve(
@NotNull BindingTrace trace,
@NotNull Collection<ResolvedCallWithTrace<D>> descriptors
);
void instantiationOfAbstractClass(@NotNull BindingTrace trace);
void unsafeCall(@NotNull BindingTrace trace, @NotNull JetType type, boolean isCallForImplicitInvoke);
@@ -1733,6 +1733,11 @@ public class JetDiagnosticsTestGenerated extends AbstractDiagnosticsTestWithEage
doTest("compiler/testData/diagnostics/tests/inference/arrayConstructor.kt");
}
@TestMetadata("cannotCompleteResolve.kt")
public void testCannotCompleteResolve() throws Exception {
doTest("compiler/testData/diagnostics/tests/inference/cannotCompleteResolve.kt");
}
@TestMetadata("completeInferenceIfManyFailed.kt")
public void testCompleteInferenceIfManyFailed() throws Exception {
doTest("compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.kt");
@@ -108,6 +108,8 @@ public class IdeErrorMessages {
MAP.put(OVERLOAD_RESOLUTION_AMBIGUITY, "<html>Overload resolution ambiguity. All these functions match. <ul>{0}</ul></html>", HTML_AMBIGUOUS_CALLS);
MAP.put(NONE_APPLICABLE, "<html>None of the following functions can be called with the arguments supplied. <ul>{0}</ul></html>",
new NoneApplicableCallsRenderer());
MAP.put(CANNOT_COMPLETE_RESOLVE, "<html>Cannot choose among the following candidates without completing type inference: <ul>{0}</ul></html>", HTML_AMBIGUOUS_CALLS);
MAP.setImmutable();
}