You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are no out-of-the-box APIs to get all top level functions (at least not as cleanly as with ClassRefeferences). Now even when we get the top-level KtNamedFunctions from the file, we cannot convert them to FunctionReferences because that API needs a declaringClassClassReference which (at least to my knowlege) we cannot get from KtNamedFunction or KtFile
Also tried KtFile.facadeClass().[...] and that was a dead end too.
How can we represent a top level function as a FunctionReference?
The text was updated successfully, but these errors were encountered:
Yes, I agree that this is an issue. I'd not advocate for an API to get all top level functions, but not being able to wrap a top level function with a FunctionReference is a problem. We didn't have a use case internally for this until now, but it's a valid one.
efemoney
changed the title
No way to create a FunctionReference to a top level function 😞
No way to create a FunctionReference to a top level function
Oct 18, 2022
We are looking at code gen use case such as below
that will generate:
There are no out-of-the-box APIs to get all top level functions (at least not as cleanly as with
ClassRefeference
s). Now even when we get the top-levelKtNamedFunction
s from the file, we cannot convert them toFunctionReference
s because that API needs adeclaringClass
ClassReference
which (at least to my knowlege) we cannot get fromKtNamedFunction
orKtFile
Also tried
KtFile.facadeClass().[...]
and that was a dead end too.How can we represent a top level function as a
FunctionReference
?The text was updated successfully, but these errors were encountered: