fun t1() { return 1 } fun t1a() { return return 1 } fun t1b() { return return 1 1 } fun t1c() { return 1 return 1 } fun t2() { if (1 > 2) return else return 1 } fun t2a() { if (1 > 2) { return 1 } else { return 2 } 1 } fun t3() { if (1 > 2) return 2 else return "" 1 } fun t4(a : Boolean) { do { return } while (a) 1 } fun t4break(a : Boolean) { do { break } while (a) 1 } fun t5() { do { return 2 } while (1 > 2) 1 } fun t6() { while (1 > 2) { return 2 } 1 } fun t6break() { while (1 > 2) { break 2 } 1 } fun t7(b : Int) { for (i in 1..b) { return 2 } 1 } fun t7break(b : Int) { for (i in 1..b) { return 2 } 1 } fun t7() { try { return 2 } catch (e : Any) { 2 } 1 // this is OK, like in Java } fun t8() { try { return 2 } catch (e : Any) { return 2 } 1 } fun blockAndAndMismatch() : Boolean { (return true) || (return false) true } fun tf() { try {return} finally{return} 1 } fun failtest(a : Int) { if (fail() || true) { } 1 } fun foo(a : Nothing) : Unit { 1 a 2 } fun fail() : Nothing { throw new java.lang.RuntimeException() }