holgerbrandl
03/25/2023, 5:24 PMfun <T> List<T>.foo(minSize: Int = 1, maxSize: Int = size, random: Random) = this
fun <T> List<T>.foo(proportion: Double = 1.0, random: Random) = this
fun main() {
listOf("some", "thing").foo(random= Random(3))
}
Using kotlin 1.8.10Youssef Shoaib [MOD]
03/25/2023, 5:32 PMholgerbrandl
03/25/2023, 5:38 PMYoussef Shoaib [MOD]
03/25/2023, 5:41 PMminSize=3
then the first function will be called). This behaviour is usually used by library devs through useless unit1: Unit = Unit, unit2: Unit = Unit
parameters• For each candidate we count the number of default parameters not specified in the call (i.e., the number of parameters for which we use the default value). The candidate with the least number of non-specified default parameters is a more specific candidate;
holgerbrandl
03/25/2023, 5:53 PMVampire
03/25/2023, 7:39 PMholgerbrandl
03/25/2023, 7:55 PM