Redundant if inspection supports now assignments and just if (...) true else false #KT-13259 Fixed

This commit is contained in:
Mikhail Glukhikh
2016-11-21 16:12:59 +03:00
parent 14787e3583
commit c6997a1213
12 changed files with 126 additions and 33 deletions
+10
View File
@@ -0,0 +1,10 @@
// "Remove redundant 'if' statement" "false"
// ACTION: Add braces to 'if' statement
// ACTION: Invert 'if' condition
// ACTION: Replace 'if' with 'when'
fun bar(p: Int) {
var v1 = false
var v2 = false
<caret>if (p > 0) v2 = true else v1 = false
}