fun getStringFromSampleObject(sampleObj: SampleObj): String = sampleObj.run {
age = 2
title = "newTitle"
isValid = true
}.toString()
val returnedValue =
Playground().getStringFromSampleObject(SampleObj(age = 1, title = "title", isValid = false))
Log.e(TAG, "Play, returned string is$returnedValue")
I try to print the return value from the function getStringFromSampleObject()
but the value of returnedValue
is kotlin.Unit
. I expect the string value instead.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…