<@U6L35JZH9> commented on <@U6L35JZH9>’s file <htt...
# getting-started
u
@adams2 commented on @adams2’s file https://kotlinlang.slack.com/files/U6L35JZH9/F7572N59P/-.kt: I ended up with something like this:
Copy code
import kotlin.reflect.KClass

//private interface TypeAdapterFactory {
//    fun <T> create(): TypeAdapter<T>?
//}

private interface TypeAdapter<T>

private class Test<T : Any>(private val klass: KClass<out T>) : TypeAdapterFactory {

    override fun <T> create(gson: Gson, type: TypeToken<T>): TypeAdapter<T>? {
		return Adapter<T>(type.rawType)
    }

    class Adapter<T : Any>(
            val clazz: Class<in T>,
    ) : TypeAdapter<T>
}