crazdrms
04/30/2018, 2:23 AMobj
is automatically cast to String
on the right-hand side of &&
if (obj is String && obj.length > 0) {
return obj.length
}
return null
}
Why is it Int here?shady-dom
04/30/2018, 2:28 AM?
basically says “forget the type, I can be null too”shady-dom
04/30/2018, 2:29 AMfun getStringLength(obj: Any): <Int or null> {
crazdrms
04/30/2018, 2:33 AMshady-dom
04/30/2018, 2:33 AMAndreas Sinz
04/30/2018, 12:01 PMcrazdrms
04/30/2018, 12:31 PM