https://kotlinlang.org logo
j

Joakim Tengstrand

06/23/2020, 7:56 PM
I want to parse Kotlin code from Java (or actually Clojure, but Java is fine). I found this link explaining how to do it:
Copy code
<https://jitinsharma.in/posts/parsing-kotlin-using-code-kotlin/>
Now I have converted that Kotlin code to Clojure, but when I try to access this field:
Copy code
public final val importList: org.jetbrains.kotlin.psi.KtImportList?
Living in this class:
Copy code
org.jetbrains.kotlin.psi.KtFile
In this library:
Copy code
org.jetbrains.kotlin/kotlin-compiler-embeddable "1.3.72"
The problem is that this field is a val and that it's not annotated with @JvmField (that is my guess) and therefore I don't know how to access it. Can I use reflection or is there another way?
k

Kroppeb

06/24/2020, 7:30 AM
getImportList()
?
2 Views