// loop backward through the list substituting as we go:
while (!inheritancePath.isEmpty()) {
InterfaceType lastType = inheritancePath.removeLast();
Type[] parameterTypes = lastType.getElement().getType().getTypeArguments();
Type[] argumentTypes = lastType.getTypeArguments();
functionTypeToReturn = functionTypeToReturn.substitute(argumentTypes, parameterTypes);
}
return functionTypeToReturn;
}
/**