Type checker error recovery fixed

This commit is contained in:
Andrey Breslav
2011-09-01 17:40:21 +04:00
parent 4d13560b9a
commit 1583b010c0
2 changed files with 3 additions and 2 deletions
@@ -145,7 +145,7 @@ public class CallResolver {
prioritizedTasks = Collections.singletonList(new ResolutionTask<FunctionDescriptor>(constructors, null, call));
}
else {
throw new UnsupportedOperationException("Type argument inference not implemented for " + call);
throw new UnsupportedOperationException("Type argument inference not implemented for " + call.getText());
}
return resolveCallToDescriptor(trace, scope, call, call.getNode(), expectedType, prioritizedTasks, functionReference);
@@ -263,6 +263,7 @@ public class CallResolver {
if (ErrorUtils.isError(candidate)) {
successfulCandidates.put(candidate, candidate);
checkTypesWithNoCallee(temporaryTrace, scope, task.getTypeArguments(), task.getValueArguments(), task.getFunctionLiteralArguments());
continue;
}
@@ -1842,8 +1842,8 @@ public class JetTypeInferrer {
JetExpression selectorExpression = expression.getSelectorExpression();
JetExpression receiverExpression = expression.getReceiverExpression();
JetType receiverType = context.services.typeInferrerVisitorWithNamespaces.getType(receiverExpression, context.replaceExpectedTypes(NO_EXPECTED_TYPE, NO_EXPECTED_TYPE));
if (receiverType == null) return null;
if (selectorExpression == null) return null;
if (receiverType == null) receiverType = ErrorUtils.createErrorType("Type for " + expression.getText());
// Clean resolution: no autocasts
TemporaryBindingTrace cleanResolutionTrace = TemporaryBindingTrace.create(context.trace);