Kotlin generics -
Kotlin generics -
how possible enforce generic type method in kotlin? know instance can following:
var somevar: mutableset<out sometype> = hashsetof()
how can same method?
fun <t> dosomething() { }
i'd enforce t
of type x
or sub-type of it.
thanks.
after googling around, right reply be:
fun <t : x> dosomething() { }
generics kotlin
Comments
Post a Comment