Jgafner
10/14/2020, 8:21 PMfun 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 ?
tnxnanodeath
10/14/2020, 8:22 PMreturn null
lines return from the entire method, not just the when
expressionJgafner
10/14/2020, 8:22 PM