// actual constraints on each of these.
Map<UniversalType, List<Type>> unifications = new HashMap<UniversalType, List<Type>>();
for (int i = 0; i < abstractArgTypes.size(); i++) {
Type abstractType = abstractArgTypes.get(i);
Type actualType = mExprTypes.get(i);
UniversalConstraintExtractor constraintExtractor = new UniversalConstraintExtractor();
if (constraintExtractor.extractConstraint(abstractType, actualType)) {
// Found a UniversalType. Make sure it's mapped to a list of actual constraints.
UniversalType univType = constraintExtractor.getUniversalType();
List<Type> actualConstraints = unifications.get(univType);
if (null == actualConstraints) {
actualConstraints = new ArrayList<Type>();
unifications.put(univType, actualConstraints);
}
// Add the actual constraint of the expression being applied as this argument.
actualConstraints.add(constraintExtractor.getConstraintType());
}
}
// Perform unifications on all the UniversalType expressions.
Map<Type, Type> unificationOut = new HashMap<Type, Type>();