Given the type reference to functional type, how would you use it in generated code so everything is resolved?
Right now i resolve reference to KSType and then recursively its type parameters. For plain functional types resolved name is FunctionN, and generated code with those works fine. But for
suspend () -> Unit
SuspendFunction
is unaccessible for user code :c So i think need something that converts
suspend () -> String
->
suspend () -> kotlin.String
. Just want to make sure not to reinvent the wheel.
t
Ting-Yuan Huang
08/06/2021, 5:14 PM
Would you elaborate on "unaccessible for user code"?
n
Nikita Klimenko [JB]
08/06/2021, 5:16 PM
SuspendFunction
is marked
internal
Nikita Klimenko [JB]
08/06/2021, 5:23 PM
Oh, or maybe its just IDE. For
suspend () -> Unit
resolved type is
kotlin.coroutines.SuspendFunction0<kotlin.Unit>
and code with this exact FQ name compiles, but IDE cannot find this declaration