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
This commit is contained in:
committed by
Mikhail Glukhikh
parent
fe9d3f16d3
commit
d08b18f5f8
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
// PROBLEM: none
|
||||
|
||||
enum class AccessMode { READ, WRITE, RW }
|
||||
fun whenExpr(mode: Boolean, access: AccessMode) {
|
||||
<caret>when (access) {
|
||||
AccessMode.READ -> if (mode) println("read") else println("noread")
|
||||
AccessMode.WRITE -> if (mode) println("write")
|
||||
AccessMode.RW -> if (mode) println("both") else println("no both")
|
||||
}
|
||||
}
|
||||
fun println(s: String) {}
|
||||
Reference in New Issue
Block a user