Dias
09/10/2018, 11:44 PMvar a: String? = null
var b: String = a as String
it doesn’t warn that this kind of cast might not be safediesieben07
09/10/2018, 11:46 PMval a: Any = Any()
val b: String = a as String
It is a checked cast, so it is not unsafe. It can throw an exception, yes, but that is the nature of casts.Dias
09/10/2018, 11:47 PMShawn
09/10/2018, 11:48 PMdiesieben07
09/10/2018, 11:48 PMShawn
09/10/2018, 11:48 PMList<Int>
to List<String>
technically, but it’s an unchecked cast since javac
erases types at compile-timediesieben07
09/10/2018, 11:49 PMDias
09/10/2018, 11:50 PM