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 -

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

database - php search bar when I press submit with nothing in the search bar it shows all the data -