Let's say I have this block of code in Groovy:
String x
String y = "hello"
def func(String str){
println(str)
}
func(x ?: y)
Is there anything wrong with using Elvis operator as an argument to a function like I did above? I tested it and it works as expected, however, I've never seen Elvis operator to be passed to a function like that.
Thanks in advance!