fixed exception in renderer for type inference error

This commit is contained in:
Svetlana Isakova
2012-10-16 17:28:24 +04:00
parent 73020fbebf
commit 0d4d576fed
4 changed files with 31 additions and 4 deletions
@@ -196,9 +196,10 @@ public class Renderers {
JetType receiverType = substitutedDescriptor.getReceiverParameter().exists() ? substitutedDescriptor.getReceiverParameter().getType() : null;
final Collection<ConstraintPosition> errorPositions = Sets.newHashSet();
List<JetType> valueArgumentTypes = Lists.newArrayList();
List<JetType> parameterTypes = Lists.newArrayList();
for (ValueParameterDescriptor valueParameterDescriptor : substitutedDescriptor.getValueParameters()) {
valueArgumentTypes.add(valueParameterDescriptor.getType());
parameterTypes.add(valueParameterDescriptor.getType());
if (valueParameterDescriptor.getIndex() >= inferenceErrorData.valueArgumentsTypes.size()) continue;
JetType actualType = inferenceErrorData.valueArgumentsTypes.get(valueParameterDescriptor.getIndex());
if (!JetTypeChecker.INSTANCE.isSubtypeOf(actualType, valueParameterDescriptor.getType())) {
errorPositions.add(ConstraintPosition.getValueParameterPosition(valueParameterDescriptor.getIndex()));
@@ -216,7 +217,7 @@ public class Renderers {
return errorPositions.contains(constraintPosition);
}
};
table.functionArgumentTypeList(receiverType, valueArgumentTypes, isErrorPosition);
table.functionArgumentTypeList(receiverType, parameterTypes, isErrorPosition);
}
table.text("can be applied to")