Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reject suspend function with Future return type #4017

Closed
wants to merge 1 commit into from

Conversation

Goooler
Copy link
Contributor

@Goooler Goooler commented Dec 19, 2023

Follow up #4013.

@@ -53,11 +54,14 @@ static <ResponseT, ReturnT> HttpServiceMethod<ResponseT, ReturnT> parseAnnotatio
responseType = Utils.getParameterUpperBound(0, (ParameterizedType) responseType);
continuationWantsResponse = true;
} else {
if (getRawType(responseType) == Call.class) {
Class<?> rawType = getRawType(responseType);
if (rawType == Call.class || Future.class.isAssignableFrom(rawType)) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we should check RxJava types as well?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't because the dependency isn't here. And we can't go by string name because of obfuscation possibility. I'm actually okay just doing Call and not doing Future or anything else. I don't think people mix and match other async types with suspend to the degree that they do Call (if at all).

@Goooler Goooler deleted the reject-more-types branch December 19, 2023 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants