-
Notifications
You must be signed in to change notification settings - Fork 44
Open
Description
Currently, as mentioned in #11 , isReturnTypeList can work with any return type which contains java.util.List.
However, this approach has some issues:
- Incorrect if the return type is something like this:
Foo<Bar<Baz<List<Something>>> - Cannot work with other collection types like
Set, Array.
I tried an update like this:
private fun isMethodWithListReturnValue(method: Method): Boolean {
if (method.returnType.isArray) {
return true
}
val genericReturnType = method.genericReturnType as? ParameterizedType ?: return false
return isArrayOrCollectionClass(genericReturnType.rawType.typeName)
}However, this doesn't work if List-type is the secondary type like: Flow<List<Something>>.
If we extract secondary type from Flow like what we did with Continuation for suspend method, we cannot guarantee whether the list is hidden under the third type like Flow<Resource<List<Type>>>.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels