Files
kotlin-fork/idea/testData/inspectionsLocal/useExpressionBody/convertToExpressionBody/lambdaWhenUnitNonExhaustive.kt.after
T
Mikhail Glukhikh d08b18f5f8 Introduce "use expression body" inspection #KT-16063 Fixed
Converted from the relevant intention
Reported cases: one-liners, whens
Also, more exact caret detection in local inspection tests
2017-07-07 18:15:06 +03:00

11 lines
296 B
Plaintext
Vendored

// 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) {}