Type checker error recovery fixed
This commit is contained in:
@@ -145,7 +145,7 @@ public class CallResolver {
|
|||||||
prioritizedTasks = Collections.singletonList(new ResolutionTask<FunctionDescriptor>(constructors, null, call));
|
prioritizedTasks = Collections.singletonList(new ResolutionTask<FunctionDescriptor>(constructors, null, call));
|
||||||
}
|
}
|
||||||
else {
|
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);
|
return resolveCallToDescriptor(trace, scope, call, call.getNode(), expectedType, prioritizedTasks, functionReference);
|
||||||
@@ -263,6 +263,7 @@ public class CallResolver {
|
|||||||
|
|
||||||
if (ErrorUtils.isError(candidate)) {
|
if (ErrorUtils.isError(candidate)) {
|
||||||
successfulCandidates.put(candidate, candidate);
|
successfulCandidates.put(candidate, candidate);
|
||||||
|
checkTypesWithNoCallee(temporaryTrace, scope, task.getTypeArguments(), task.getValueArguments(), task.getFunctionLiteralArguments());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1842,8 +1842,8 @@ public class JetTypeInferrer {
|
|||||||
JetExpression selectorExpression = expression.getSelectorExpression();
|
JetExpression selectorExpression = expression.getSelectorExpression();
|
||||||
JetExpression receiverExpression = expression.getReceiverExpression();
|
JetExpression receiverExpression = expression.getReceiverExpression();
|
||||||
JetType receiverType = context.services.typeInferrerVisitorWithNamespaces.getType(receiverExpression, context.replaceExpectedTypes(NO_EXPECTED_TYPE, NO_EXPECTED_TYPE));
|
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 (selectorExpression == null) return null;
|
||||||
|
if (receiverType == null) receiverType = ErrorUtils.createErrorType("Type for " + expression.getText());
|
||||||
|
|
||||||
// Clean resolution: no autocasts
|
// Clean resolution: no autocasts
|
||||||
TemporaryBindingTrace cleanResolutionTrace = TemporaryBindingTrace.create(context.trace);
|
TemporaryBindingTrace cleanResolutionTrace = TemporaryBindingTrace.create(context.trace);
|
||||||
|
|||||||
Reference in New Issue
Block a user