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