fun foo() { Any() as String } fun main(args: Array) { try { foo() } catch (e: Throwable) { println("Ok") return } println("Fail") }