Closed opekope2 closed 1 year ago
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: https://github.com/FabricMC/fabric-language-kotlin/pull/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.
As I described it in https://github.com/opekope2/OptiGUI/issues/80#issuecomment-1788893541, when I specify a top level function reference as an entry point. After a recent change in Kotlin reflection (https://github.com/JetBrains/kotlin/commit/5dc882abf5727117d944fddeb934ecf92a8a4927, Kotlin 1.9.20),
k.objectInstance
returnsnull
instead of throwingUnsupportedOperationException
, soKotlinAdapter
doesn't fall back to the default adapter.