Why is it that this: ``` fun retrieveNavigatio...
# getting-started
l
Why is it that this:
Copy code
fun retrieveNavigationItem(context: Context, key: String) =
        ObjectInputStream(File(context.filesDir, key).inputStream()).readObject() as NavigationItem?
Is perfectly accepted by the Kotlin compiler, but this:
Copy code
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?