fun doSomething() {} fun test() { var res: String? = null res = try { "success" } catch (e: Exception) { "failure" } finally { doSomething() } }