https://kotlinlang.org logo
#serialization
Title
# serialization
m

MV

11/24/2023, 9:33 PM
Is there a way to set a upperbound for a generic that only allows types that have
@Serializable
?
Copy code
inline fun <reified T> sendReturnForwards(
        key: String,
        value: T,
    ) {
        navController.currentBackStackEntry?.savedStateHandle?.set(key, Json.encodeToString(value))
    }
e

ephemient

11/25/2023, 3:30 AM
no. you can make the caller pass a serializer into the function though