and this: `class ClassFactory<out T> private...
# eap
d
and this:
class ClassFactory<out T> private constructor(val clazz: Class<out T>, internal: kotlin.Boolean) {
makes toMap call-site to work, but not the definition
u
I’ve tried the following, and it seems to work
Copy code
class ClassFactory<T>(val clazz: Class<out T>) {
    fun toMap(instance: T): Map<String, Any?> {
        return emptyMap()
    }
}

fun test(x: Any?) {
    when (x) {
        null -> {}
        else -> {
            ClassFactory(x::class.java).toMap(x)
        }
    }
}
d
uhm
maybe it's a bug then that reproduces with a more complex example
going to try to reduce it
👍 1
ok, it was my problem. It has a operator fun invoke for constructing in order to be able to cache it, and I didn't changed the Class<out> for that case 🙂
thank you for your time! its working now
u
no problem, thanks for the report