java.lang.NoSuchFieldError : INSTANCE

I’m starting here instead of a youtrack issue because I cannot recreate the issue in an MRE and I cannot post the project because it is company code. I’m hoping someone can lead me to reproduce it as an MRE here.

I have a normal jvm project with a unit test. This unit test ends up using this object declaration. During runtime, it throws the exception java.lang.NoSuchFieldError : INSTANCE here:

My understanding is that object types are compiled to a class with a static member INSTANCE, and when I decompile PageInfo.class, it does not have this member. I use other objects and this weirdness only occurs here as far as I can tell. I have tried plugin version 1.7.10, 1.7.21, 1.8.0, 1.8.10. I have tried with jdk versions 1.8, 15, and 17. I have invalidated all caches, deleted all gradle caches, and rebuilt from scratch entirely, and this error still presents.

I tried reproducing it as best as I can, creating an operator function ! that returns a delegate, and just like this code, also provided a provideDelegate function in a very similar manner to what is on that ObjectType class and nothing like this occurs. Any help is appreciated.

I don’t quite understand your issue. Can you break it down a bit more for me?

I’m not sure if your initial issue involves using an object as a delegate, or if that’s something you’re trying to do to replicate the initial issue? Also, could you include the code for your ! function that creates a delegate, or whatever it does?

If your original issue has nothing to do with delegates, can you please remove them to simplify the problem?