Viral Thakker
09/14/2018, 9:54 AMmarstran
09/14/2018, 9:56 AMmarstran
09/14/2018, 9:58 AMwhen(typeName) {
"Int" -> object as Int
"String" -> object as String
// List all types you want to cast to.
else -> object
}
Nikky
09/14/2018, 10:05 AMas Type
does not change anything in the object
so at some point it would get bunched together again as Any
and nothing is gained
unless you want to have your ClassCastException thrown exactly there