Hello!
fun <T> cast(from: Any): T? = from as? T
val x = cast<String>(42) // java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
Is it expected behaviour? I thought as? operator should suppress exception and return null.
Thanks!