Eliminate IllegalArgumentException caused by possible negative sized ArrayList creation
This commit is contained in:
@@ -870,7 +870,7 @@ public abstract class KotlinBuiltIns {
|
|||||||
List<TypeProjection> arguments = type.getArguments();
|
List<TypeProjection> arguments = type.getArguments();
|
||||||
int first = isExtensionFunctionType(type) ? 1 : 0;
|
int first = isExtensionFunctionType(type) ? 1 : 0;
|
||||||
int last = arguments.size() - 2;
|
int last = arguments.size() - 2;
|
||||||
List<TypeProjection> parameterTypes = new ArrayList<TypeProjection>(last - first + 1);
|
List<TypeProjection> parameterTypes = new ArrayList<TypeProjection>(Math.max(0, last - first + 1));
|
||||||
for (int i = first; i <= last; i++) {
|
for (int i = first; i <= last; i++) {
|
||||||
parameterTypes.add(arguments.get(i));
|
parameterTypes.add(arguments.get(i));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user