docs: private Optional<SoyType> soyTypeForProtoOrEnum(Class<?> type, Method method) {
      // Message isn't supported because we can't get a descriptor from it.
      if (type == Message.class) {
        reporter.invalidReturnType(Message.class, method);
        return Optional.absent();
      }
      Optional<String> fullName = nameFromDescriptor(type);
      if (!fullName.isPresent()) {
        reporter.incompatibleReturnType(type, method);
        return Optional.absent();
      }
      SoyType returnType = registry.getType(fullName.get());
      if (returnType == null) {
        reporter.incompatibleReturnType(type, method);
        return Optional.absent();
      }
      return Optional.of(returnType);
    }