<I want generic type of Any BUT NOT of type KClass...
# forum
r
I want generic type of Any BUT NOT of type KClass<Any> In kotlin KClass is sub class of Any… But how can I tell that I want the Object and not KClass? For example… public fun test(kclass: KClass, obj: T){ println("Hello from KClass, T") } Clearly… we can see that function accepts class reference and object… Wrong!!! Nothing stops you to call it like this… test(String::class, String::class) Ps: I’m writing library where I have overloading functions objects/classes and I need distinctions between KClass and Object class Test you Kotlin...