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

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

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -