Hi Can someone please explain me this code ? ```fu...
# getting-started
j
Hi Can someone please explain me this code ?
Copy code
fun aFun() : ObjectA?{
val (side,line) = when(someData){
      is TypeA -> thread.position?.let { diffData.linesMapper.findFileLocation(it) } ?: return null
      is TypeB -> ... ?: return null
}

return ObjectA(side,line)
when ObjectA constructor is expecting null safe type of side and line. in case of is TypeA happen and it return null what will be the values in side and line ? tnx
n
the
return null
lines return from the entire method, not just the
when
expression
j
tnx!!!
👍 1