Is there any way that I can guarantuee/force that ...
# kotlin-native
v
Is there any way that I can guarantuee/force that a class and its companion object(s) have been initialized when I want to do something with a
KClass<SomeLibraryType>
? It looks like the companion objects are only initialized lazily when the first instance of that class is created. For a custom typesystem in K/N I need to access the companion object of a given
KClass<SomeLibraryType>
received through an inline reified fun so I can lookup some type information and casting functions.
I have full control over all the library types to which this applies so I can brute-force register all the library types up front in some initializer as a last resort, but I would prefer not to do that since the list of library types is huge and it's a lot of loading/init for types that are not going to be used.