So for example, you would need reflect for this to...
# announcements
c
So for example, you would need reflect for this to work:
Copy code
operator fun <V : Any?> SharedPreferences.setValue(thisRef: Any?, property: KProperty<*>, value: V?) {
    val name = getPrefName(thisRef, property)
    edit()
            .apply {
                when (property.returnType) {
                    String::class -> putString(name, value as String)
                    Int::class -> putInt(name, value as Int)
                    Float::class -> putFloat(name, value as Float)
                    Long::class -> putLong(name, value as Long)
                }
            }
            .apply()
}