Is there a way to use `T` here to not having to pa...
# announcements
i
Is there a way to use
T
here to not having to pass
clazz
? With reified parameter or something?
Copy code
fun <T> getObject(key: PreferencesKey, clazz: Class<T>): T? =
    getString(key)?.let {
        gson.fromJson(it, clazz)
    }
t
inline fun <reified T: Any> .... it, T::class.java
i
right. But that requires the function to be inline...
and I've declared it in an interface. Does that mean I can't use this?