locke
03/08/2018, 7:08 PMfun retrieveNavigationItem(context: Context, key: String) =
ObjectInputStream(File(context.filesDir, key).inputStream()).readObject() as NavigationItem?
Is perfectly accepted by the Kotlin compiler, but this:
fun <T : Serializable>retrieveSerializable(context: Context, key: String) =
ObjectInputStream(File(context.filesDir, key).inputStream()).readObject() as T?
Gives me a warning saying unchecked cast? Since NavigationItem : Serializable
I don't understand the difference that would cause one to warn?