Validate return value and return list of errors messages.

def _ValidateReturnValue(return_value, type_check_dict):
  """Validate return value and return list of errors messages."""
  return_check = type_check_dict.get("returns", None)
  if not return_check:
    return []

  messages = []
  if not _ValidateValue(return_value, return_check):
    message = ("Invalid return value '%s'. Expected %s" %
               (return_value, _FormatTypeCheck(return_check)))
    messages.append(message)
  return messages