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

Popular posts from this blog

php - How to pass multiple values from url -

php - Laravel not returning controller -

c# - Confused on how to specify a Platform and Version while using ChromeOptions for RemoteWebDriver with Selenium donNet since recent updates -