thanksforallthefish
06/09/2022, 5:44 AMfun cast(value: Any?) = (value as? Map<String, String?>)
?
maybe followup question, am I misusing as?
? context, in this scenario I know that value
might not be a map, so using as?
on purpose since it returns null
, but this “null-trick” makes the cast safe in my eyes, since `null`s need to be handled explicitlyJoffrey
06/09/2022, 6:28 AMthanksforallthefish
06/09/2022, 6:38 AMString
part, somehow I thought it was complaining about the Map