amadeu01
01/22/2019, 1:02 PMmyObj?.let { myOtherObj.property = it }
myObj?.let(myOtherObj.property::set)
I was wondering. I just want to set a variable to other object property if my variable is not null. So, could a do something like above .let(myOtherObj.property::set)
?hudsonb
01/22/2019, 1:16 PMlet
the closest syntax would be:
myObj?.let { (myOtherObj::set)(it) }
hudsonb
01/22/2019, 1:17 PMamadeu01
01/22/2019, 1:24 PM