Top level function reference entry points don't work
opekope2 opened this issue · 4 comments
As I described it in opekope2/OptiGUI#80 (comment), when I specify a top level function reference as an entry point.
After a recent change in Kotlin reflection (JetBrains/kotlin@5dc882a, Kotlin 1.9.20), k.objectInstance
returns null
instead of throwing UnsupportedOperationException
, so KotlinAdapter
doesn't fall back to the default adapter.
Uhh, thats a sneaky change. Ill mark FLK with Kotlin 1.9.20 as a beta, and look into fixing this.
QKL falls back to the default adapter, if k.objectInstance
returns null or throws an exception.
Kotlin top level functions will compile to a static method, which works with the default adapter.
I have made a PR for this here: #121 It seems to solve it. Before I release this I want to test with some other Kotlin mods to ensure I havent broken them.