Paul Woitaschek
11/04/2021, 7:38 AMkotlinx.coroutines.flow.Flow
. When entering visitFunctionDeclaration
is there any way to get the complete return type? (not only "Flow")?
The only solution I have found so far is to call:
function.returnType?.resolve()?.declaration?.qualifiedName?.asString()
but that would force me to resolve just all functions which is documented as "expensive". Is there a way to do it without resolving all functions?efemoney
11/04/2021, 8:43 AMPaul Woitaschek
11/04/2021, 8:43 AMtypealias Wolf<T> = Flow<T>
lead to Wolf
?efemoney
11/04/2021, 8:45 AMPaul Woitaschek
11/04/2021, 8:46 AMefemoney
11/04/2021, 8:53 AMvisit
type aliases to mark “interesting” ones (typealiases of Flow or typealiases of the aforementioned typealiases) that in a subsequent round of processing you can then search for in function return typesGrégory Lureau
11/04/2021, 9:42 AMPaul Woitaschek
11/04/2021, 9:43 AMGrégory Lureau
11/04/2021, 9:49 AMevant
11/04/2021, 2:40 PMGrégory Lureau
11/04/2021, 2:55 PMJiaxiang
11/04/2021, 6:16 PMname
is a good optimization, however it does not handle type alias well. Actually in KSP development we had similar challenge when implementing getSymbolsWithAnnotation
, effort to optimize with typealias in mind is non-trivial. I would suggest use annotation to mark the symbols you want to process.