Join Slack
Hello! Is there any way to itarate through all class descriptors in module descriptor?
# compiler
p
PHondogo
05/16/2020, 4:26 PM
Hello! Is there any way to itarate through all class descriptors in module descriptor?
r
raulraja
05/16/2020, 5:27 PM
yes you can get access to those through the memberScope.getContributedDescriptors inside the package fragment descriptor
raulraja
05/16/2020, 5:28 PM
classes but also property and package level functions
raulraja
05/16/2020, 5:28 PM
classdescriptor covers interface, object and class
raulraja
05/16/2020, 5:29 PM
For example
https://github.com/arrow-kt/arrow-meta/blob/e3c602633948dad3594cce9a22035e0d06e3b1a7/compiler-plugin/src/main/kotlin/arrow/meta/plugins/proofs/phases/resolve/cache/ProofsCache.kt#L58
raulraja
05/16/2020, 6:47 PM
String | Int
as syntax you type is not possible without grammar changes to the lang because there is currently no support for infix types or type aliases
raulraja
05/16/2020, 6:48 PM
it won’t get to AST, fails parsing
p
PHondogo
05/16/2020, 6:50 PM
Thanks, Raul!
👍 1
50
Views
Open in Slack
Previous
Next
kotlinlang
A modern programming language that makes developers happier.
Powered by