mardi 5 octobre 2021

Overloading on reference to method of a particular instance in Kotlin

It's clear on how to reference a method of a particular instance: Reference to method of a particular instance in Kotlin

e.g.

val f = a::getItem

However what if getItem is overloaded? I cannot seem to find any material on that.

Let's assume the getItem has the following overloaded functions:

getItem (String) -> Item
getItem (String, Metrics) -> Item

How do I select any particular function by bound instance callable?





Aucun commentaire:

Enregistrer un commentaire