Convert to expression body: take nested whens into account
This commit is contained in:
+11
@@ -0,0 +1,11 @@
|
||||
// IS_APPLICABLE: true
|
||||
enum class AccessMode { READ, WRITE, RW }
|
||||
fun <T> run(f: () -> T) = f()
|
||||
fun whenExpr(access: AccessMode) = run {
|
||||
println("run")
|
||||
when (access) {
|
||||
AccessMode.READ -> println("read")
|
||||
AccessMode.WRITE -> println("write")
|
||||
}
|
||||
}
|
||||
fun println(s: String) {}
|
||||
Reference in New Issue
Block a user