Erik
10/16/2022, 2:54 PMfun foo
in this runnable example in a way that doesn't provide a value for the first parameter with a default value? The types of the first two parameters happen to be compatible, which is unfortunate (even though they're not the same!)Erik
10/16/2022, 2:56 PMvararg
Youssef Shoaib [MOD]
10/16/2022, 2:58 PMErik
10/16/2022, 2:58 PMErik
10/16/2022, 2:58 PMYoussef Shoaib [MOD]
10/16/2022, 3:04 PMoptionalParameter
is a Long and the other varargs as Int, it should be a comparable situationErik
10/16/2022, 3:09 PMdmitriy.novozhilov
10/16/2022, 7:14 PMfoo(
optionalParameter = {},
{ println("I want to be the first extra parameter, but I'm the optional parameter") },
{ println("Another one") },
{ println("Yet another one") },
)
Erik
10/16/2022, 8:55 PMErik
10/16/2022, 8:55 PM