List<Name> remaining = paramNames;
// assert: remaining and paramNames are both empty or both
// have same cardinality as type.getParameterTypes()
int i = 0;
for (Type t : type.getParameterTypes()) {
Name paramName;
if (remaining.isEmpty()) {
// no names for any parameters available
paramName = createArgName(i, paramNames);
} else {
paramName = remaining.head;
remaining = remaining.tail;
if (paramName.isEmpty()) {
// no name for this specific parameter
paramName = createArgName(i, paramNames);
}
}
buf.append(new VarSymbol(PARAMETER, paramName, t, this));