# general-advice

Alexander Städing

11/23/2023, 11:01 AM
I'm getting a really weird
. For some reason, I can't access methods from a companion object:
Copy code
java.lang.IllegalAccessError: class org.anvilpowered.catalyst.api.config.CatalystKeys$special$$inlined$buildingSimple$1 tried to access field org.anvilpowered.anvil.core.config.Key$Companion.$$INSTANCE
I'm using the latest Kotlin version 1.9.20. I first thought it was due to Java 21 support not being quite there yet, but it also happens with Java 17. Nothing in this class is private or protected. Here is the class that is being accessed:[…]/core/src/main/kotlin/org/anvilpowered/anvil/core/config/Key.kt Here is the code accessing the class:[…]ain/kotlin/org/anvilpowered/catalyst/api/config/CatalystKeys.kt Here is the full stacktrace: Is this a Kotlin bug or am I doing something wrong? Let me know if I should create a minimal example. Thanks for any advice.