i have query that is it fine to use to use named parameter which having name parameter and the variable name same in a function call
for example
fun fun1( to:string ){
//body}
fun fun2( ){
to = "xyz"
fun1( to = to)
}
calling fun1 which have a parameter name "to" and passing variable "to" is it okay to do so . In either of case can someone also explain how the compiler will resolve this
to
infun2
gets"xyz"
. I assume you're coming from a C background or a language that lets you do assignment in a function argument. You can't do assignment in a function argument in Kotlin (try it) so there's no ambiguity.