KT-799 Allow 'return' expressions in conditionals assigned to variables
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package kt799
|
||||
|
||||
fun foo(b: Boolean) : String {
|
||||
val a = if (b) true else return "false"
|
||||
return "$a"
|
||||
}
|
||||
|
||||
fun box() = if (foo(true) == "true" && foo(false) == "false") "OK" else "fail"
|
||||
Reference in New Issue
Block a user